hopefully the last complete restructure of this repo
This commit is contained in:
@@ -1,76 +0,0 @@
|
||||
{ config, lib, pkgs, core_inputs, ... }: {
|
||||
|
||||
imports = [
|
||||
./laptop
|
||||
./homebox
|
||||
];
|
||||
|
||||
sysconfig.laptop.enable = lib.mkDefault false;
|
||||
sysconfig.homebox.enable = lib.mkDefault false;
|
||||
|
||||
# Set your time zone.
|
||||
time.timeZone = "America/Chicago";
|
||||
|
||||
# Select internationalisation properties.
|
||||
i18n.defaultLocale = "en_US.UTF-8";
|
||||
|
||||
i18n.extraLocaleSettings = {
|
||||
LC_ADDRESS = "en_US.UTF-8";
|
||||
LC_IDENTIFICATION = "en_US.UTF-8";
|
||||
LC_MEASUREMENT = "en_US.UTF-8";
|
||||
LC_MONETARY = "en_US.UTF-8";
|
||||
LC_NAME = "en_US.UTF-8";
|
||||
LC_NUMERIC = "en_US.UTF-8";
|
||||
LC_PAPER = "en_US.UTF-8";
|
||||
LC_TELEPHONE = "en_US.UTF-8";
|
||||
LC_TIME = "en_US.UTF-8";
|
||||
};
|
||||
|
||||
# Define a user account. Don't forget to set a password with ‘passwd’.
|
||||
users.users.${config.sysconfig.opts.username} = {
|
||||
isNormalUser = true;
|
||||
description = "Nathan";
|
||||
initialPassword = "7567";
|
||||
extraGroups = [
|
||||
"networkmanager"
|
||||
"wheel"
|
||||
"adbusers"
|
||||
#school?
|
||||
"plugdev"
|
||||
];
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
networking = {
|
||||
hostName = config.sysconfig.opts.host;
|
||||
nameservers = [ "1.1.1.1#one.one.one.one" "1.0.0.1#one.one.one.one" ];
|
||||
networkmanager.enable = true;
|
||||
};
|
||||
|
||||
|
||||
nix.settings = {
|
||||
experimental-features = [ "nix-command" "flakes" ];
|
||||
substituters = ["https://hyprland.cachix.org"];
|
||||
trusted-public-keys = ["hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc="];
|
||||
};
|
||||
|
||||
xdg.portal = {
|
||||
enable = true;
|
||||
config.common.default = "*";
|
||||
extraPortals = with pkgs; [ xdg-desktop-portal-gtk ];
|
||||
};
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
gst_all_1.gstreamer
|
||||
gst_all_1.gst-plugins-base
|
||||
gst_all_1.gst-plugins-good
|
||||
gst_all_1.gst-plugins-bad
|
||||
gst_all_1.gst-plugins-ugly
|
||||
|
||||
home-manager
|
||||
];
|
||||
|
||||
fonts.packages = with pkgs; [ nerdfonts ];
|
||||
}
|
||||
@@ -1,86 +0,0 @@
|
||||
# Edit this configuration file to define what should be installed on
|
||||
# your system. Help is available in the configuration.nix(5) man page
|
||||
# and in the NixOS manual (accessible by running ‘nixos-help’).
|
||||
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
{
|
||||
|
||||
options.sysconfig.homebox.enable = lib.options.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = false;
|
||||
};
|
||||
|
||||
config = lib.mkIf config.sysconfig.homebox.enable {
|
||||
|
||||
nixpkgs.config.allowUnfree = true;
|
||||
|
||||
assertions = [
|
||||
{
|
||||
assertion = !config.sysconfig.laptop.enable;
|
||||
message = "sysconfig homebox conflicts with laptop";
|
||||
}
|
||||
];
|
||||
|
||||
|
||||
boot = {
|
||||
loader = {
|
||||
systemd-boot.enable = true;
|
||||
efi.canTouchEfiVariables = true;
|
||||
};
|
||||
kernelParams = [ "initcall_blacklist=simpledrm_platform_driver_init" ];
|
||||
};
|
||||
|
||||
hardware = {
|
||||
opengl = {
|
||||
enable = true;
|
||||
driSupport = true;
|
||||
extraPackages = with pkgs; [
|
||||
nvidia-vaapi-driver
|
||||
];
|
||||
};
|
||||
|
||||
nvidia = {
|
||||
modesetting.enable = true;
|
||||
open = true;
|
||||
nvidiaSettings = true;
|
||||
package = config.boot.kernelPackages.nvidiaPackages.beta;
|
||||
};
|
||||
|
||||
bluetooth.enable = true;
|
||||
|
||||
pulseaudio.enable = false;
|
||||
};
|
||||
environment.shells = with pkgs; [ zsh ];
|
||||
programs.zsh.enable = true;
|
||||
users.defaultUserShell = pkgs.zsh;
|
||||
|
||||
sysconfig.opts = {
|
||||
openssh.enable = true;
|
||||
pipewire.enable = true;
|
||||
hyprland.enable = true;
|
||||
git.enable = true;
|
||||
ags.enable = true;
|
||||
nh.enable = true;
|
||||
steam.enable = false;
|
||||
};
|
||||
|
||||
services = {
|
||||
xserver = {
|
||||
enable = true;
|
||||
videoDrivers = [ "nvidia" ];
|
||||
};
|
||||
|
||||
displayManager.enable = true;
|
||||
};
|
||||
|
||||
environment = {
|
||||
sessionVariables = {
|
||||
# WLR_BACKENDS = "headless";
|
||||
# WLR_LIBINPUT_NO_DEVICES = "1";
|
||||
};
|
||||
};
|
||||
|
||||
system.stateVersion = "24.05";
|
||||
};
|
||||
}
|
||||
@@ -1,26 +0,0 @@
|
||||
# Do not modify this file! It was generated by ‘nixos-generate-config’
|
||||
# and may be overwritten by future invocations. Please make changes
|
||||
# to /etc/nixos/configuration.nix instead.
|
||||
{ config, lib, pkgs, modulesPath, ... }:
|
||||
|
||||
{
|
||||
imports =
|
||||
[ (modulesPath + "/installer/scan/not-detected.nix")
|
||||
];
|
||||
|
||||
boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "ahci" "usbhid" ];
|
||||
boot.initrd.kernelModules = [ ];
|
||||
boot.kernelModules = [ "kvm-amd" ];
|
||||
boot.extraModulePackages = [ ];
|
||||
|
||||
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
|
||||
# (the default) this is the recommended approach. When using systemd-networkd it's
|
||||
# still possible to use this option, but it's recommended to use it in conjunction
|
||||
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
|
||||
networking.useDHCP = lib.mkDefault true;
|
||||
# networking.interfaces.enp6s0.useDHCP = lib.mkDefault true;
|
||||
# networking.interfaces.wlp7s0.useDHCP = lib.mkDefault true;
|
||||
|
||||
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
||||
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
||||
}
|
||||
@@ -1,126 +0,0 @@
|
||||
# Edit this configuration file to define what should be installed on
|
||||
# your system. Help is available in the configuration.nix(5) man page
|
||||
# and in the NixOS manual (accessible by running ‘nixos-help’).
|
||||
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
{
|
||||
|
||||
options.sysconfig.laptop.enable = lib.options.mkOption {
|
||||
type = lib.types.bool;
|
||||
};
|
||||
|
||||
config = lib.mkIf config.sysconfig.laptop.enable {
|
||||
|
||||
assertions = [
|
||||
{
|
||||
assertion = !config.sysconfig.homebox.enable;
|
||||
message = "sysconfig.laptop conflicts with homebox!";
|
||||
}
|
||||
];
|
||||
|
||||
|
||||
nixpkgs.config.allowUnfree = true;
|
||||
|
||||
# Bootloader.
|
||||
boot = {
|
||||
loader = {
|
||||
systemd-boot.enable = true;
|
||||
efi.canTouchEfiVariables = true;
|
||||
};
|
||||
kernelParams = [ "snd-intel-dspcfg.dsp_driver=1" ];
|
||||
};
|
||||
|
||||
hardware = {
|
||||
#graphics.enable = true;
|
||||
|
||||
opengl = {
|
||||
enable = true;
|
||||
driSupport = true;
|
||||
};
|
||||
|
||||
nvidia = {
|
||||
modesetting.enable = true;
|
||||
powerManagement.enable = true;
|
||||
powerManagement.finegrained = false;
|
||||
open = false;
|
||||
nvidiaSettings = true;
|
||||
package = config.boot.kernelPackages.nvidiaPackages.beta;
|
||||
|
||||
prime = {
|
||||
# Make sure to use the correct Bus ID values for your system!
|
||||
intelBusId = "PCI:0:2:0";
|
||||
nvidiaBusId = "PCI:1:0:0";
|
||||
# WARNING: sync and offload are mutually exclusive.
|
||||
# You can only pick one!!
|
||||
#sync.enable = true;
|
||||
offload = {
|
||||
enable = true;
|
||||
enableOffloadCmd = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
#enable bluetooth
|
||||
bluetooth.enable = true;
|
||||
|
||||
pulseaudio.enable = false;
|
||||
};
|
||||
|
||||
sysconfig.opts = {
|
||||
openssh.enable = false;
|
||||
steam.enable = true;
|
||||
pipewire.enable = true;
|
||||
ags.enable = true;
|
||||
hyprland.enable = true;
|
||||
git.enable = true;
|
||||
nh.enable = true;
|
||||
};
|
||||
|
||||
# Enable the X11 windowing system.
|
||||
services.xserver = {
|
||||
enable = true;
|
||||
videoDrivers = ["nvidia"];
|
||||
|
||||
};
|
||||
|
||||
services.displayManager.enable = true;
|
||||
|
||||
services.avahi = {
|
||||
|
||||
enable = true;
|
||||
ipv4 = true;
|
||||
ipv6 = true;
|
||||
openFirewall = true;
|
||||
nssmdns4 = true;
|
||||
wideArea = true;
|
||||
|
||||
};
|
||||
|
||||
# Configure network proxy if necessary
|
||||
# networking.proxy.default = "http://user:password@proxy:port/";
|
||||
# networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain";
|
||||
|
||||
|
||||
environment.shells = with pkgs; [ zsh ];
|
||||
|
||||
# Enable CUPS to print documents.
|
||||
services.printing.enable = true;
|
||||
|
||||
# Enable touchpad support (enabled default in most desktopManager).
|
||||
# services.xserver.libinput.enable = true;
|
||||
|
||||
programs.adb.enable = true;
|
||||
|
||||
users.defaultUserShell = pkgs.zsh;
|
||||
programs.zsh.enable = true;
|
||||
|
||||
# This value determines the NixOS release from which the default
|
||||
# settings for stateful data, like file locations and database versions
|
||||
# on your system were taken. It‘s perfectly fine and recommended to leave
|
||||
# this value at the release version of the first install of this system.
|
||||
# Before changing this value read the documentation for this option
|
||||
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
|
||||
system.stateVersion = "23.05"; # Did you read the comment?
|
||||
|
||||
};
|
||||
}
|
||||
@@ -1,39 +0,0 @@
|
||||
# Do not modify this file! It was generated by ‘nixos-generate-config’
|
||||
# and may be overwritten by future invocations. Please make changes
|
||||
# to /etc/nixos/configuration.nix instead.
|
||||
{ config, lib, pkgs, modulesPath, ... }:
|
||||
|
||||
{
|
||||
imports =
|
||||
[ (modulesPath + "/installer/scan/not-detected.nix")
|
||||
];
|
||||
|
||||
boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usb_storage" "sd_mod" "sdhci_pci" ];
|
||||
boot.initrd.kernelModules = [ ];
|
||||
boot.kernelModules = [ "kvm-intel" ];
|
||||
boot.extraModulePackages = [ ];
|
||||
|
||||
fileSystems."/" =
|
||||
{ device = "/dev/disk/by-uuid/78c0964d-c09e-4e31-8a73-eb719d79917a";
|
||||
fsType = "ext4";
|
||||
};
|
||||
|
||||
fileSystems."/boot" =
|
||||
{ device = "/dev/disk/by-uuid/AE5E-AC86";
|
||||
fsType = "vfat";
|
||||
options = [ "fmask=0022" "dmask=0022" ];
|
||||
};
|
||||
|
||||
swapDevices = [ ];
|
||||
|
||||
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
|
||||
# (the default) this is the recommended approach. When using systemd-networkd it's
|
||||
# still possible to use this option, but it's recommended to use it in conjunction
|
||||
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
|
||||
networking.useDHCP = lib.mkDefault true;
|
||||
# networking.interfaces.eno1.useDHCP = lib.mkDefault true;
|
||||
# networking.interfaces.wlo1.useDHCP = lib.mkDefault true;
|
||||
|
||||
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
||||
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
||||
}
|
||||
@@ -1,77 +0,0 @@
|
||||
{
|
||||
description = "install nixos declaratively";
|
||||
|
||||
inputs = {
|
||||
|
||||
nixpkgs.url = "github:nixos/nixpkgs/nixos-24.05";
|
||||
|
||||
disko = {
|
||||
url = "github:nix-community/disko";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
impermanence.url = "github:nix-community/impermanence";
|
||||
};
|
||||
|
||||
outputs = { ... }@inputs: let
|
||||
system = "x86_64-linux";
|
||||
devices = {
|
||||
main = "/dev/nvme0n1";
|
||||
bonus.disk1 = "/dev/nvme1n1";
|
||||
};
|
||||
|
||||
pkgs = import inputs.nixpkgs {
|
||||
inherit system;
|
||||
config.allowUnfree = true;
|
||||
};
|
||||
in {
|
||||
|
||||
nixosConfigurations.homebox = inputs.nixpkgs.lib.nixosSystem {
|
||||
|
||||
inherit system;
|
||||
|
||||
modules = [
|
||||
inputs.disko.nixosModules.default
|
||||
inputs.impermanence.nixosModules.impermanece
|
||||
./disko
|
||||
./impermanece
|
||||
];
|
||||
|
||||
sysconfig.opts = {
|
||||
inherit devices;
|
||||
};
|
||||
|
||||
disko = {
|
||||
enable = true;
|
||||
impermanent = true;
|
||||
};
|
||||
|
||||
|
||||
nix.settings = {
|
||||
experimental-features = [ "nix-command" "flakes" ];
|
||||
substituters = ["https://hyprland.cachix.org"];
|
||||
trusted-public-keys = ["hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc="];
|
||||
};
|
||||
|
||||
networking = {
|
||||
hostName = "homebox";
|
||||
nameservers = [ "1.1.1.1#one.one.one.one" "1.0.0.1#one.one.one.one" ];
|
||||
networkmanager.enable = true;
|
||||
};
|
||||
|
||||
users.users."nathan" = {
|
||||
isNormalUser = true;
|
||||
description = "Nathan";
|
||||
initialPassword = "7567";
|
||||
extraGroups = [ "wheel" "networkmanager" ];
|
||||
};
|
||||
|
||||
services.openssh.enable = true;
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
git
|
||||
home-manager
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
{ config, lib, ... }: {
|
||||
|
||||
options = {
|
||||
disko = {
|
||||
enable = lib.options.mkOption {
|
||||
default = false;
|
||||
type = lib.types.bool;
|
||||
};
|
||||
impermanent = lib.options.mkOption {
|
||||
default = false;
|
||||
type = lib.types.bool;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
imports = [
|
||||
./disko.nix
|
||||
./disko_bonus.nix
|
||||
./impermanent.nix
|
||||
];
|
||||
|
||||
config = lib.mkIf config.disko.enable (lib.mkMerge [
|
||||
|
||||
(lib.mkIf (!config.disko.enable) {
|
||||
disko.impermanent = lib.mkForce false;
|
||||
})
|
||||
]);
|
||||
}
|
||||
@@ -1,79 +0,0 @@
|
||||
{ config, lib, ... }: {
|
||||
|
||||
options.sysconfig.opts.devices.main = lib.options.mkOption {
|
||||
type = lib.types.str;
|
||||
default = null;
|
||||
};
|
||||
|
||||
config = lib.mkIf config.disko.enable {
|
||||
disko.devices = {
|
||||
disk.main = {
|
||||
device = config.sysconfig.opts.devices.main;
|
||||
type = "disk";
|
||||
content = {
|
||||
type = "gpt";
|
||||
partitions = {
|
||||
boot = {
|
||||
name = "boot";
|
||||
size = "1M";
|
||||
type = "EF02";
|
||||
};
|
||||
esp = {
|
||||
name = "ESP";
|
||||
size = "500M";
|
||||
type = "EF00";
|
||||
content = {
|
||||
type = "filesystem";
|
||||
format = "vfat";
|
||||
mountpoint = "/boot";
|
||||
};
|
||||
};
|
||||
swap = {
|
||||
size = "4G";
|
||||
content = {
|
||||
type = "swap";
|
||||
resumeDevice = true;
|
||||
};
|
||||
};
|
||||
root = {
|
||||
name = "root";
|
||||
size = "100%";
|
||||
content = {
|
||||
type = "lvm_pv";
|
||||
vg = "root_vg";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
lvm_vg = {
|
||||
root_vg = {
|
||||
type = "lvm_vg";
|
||||
lvs = {
|
||||
root = {
|
||||
size = "100%FREE";
|
||||
content = {
|
||||
type = "btrfs";
|
||||
extraArgs = [ "-f" ];
|
||||
subvolumes = {
|
||||
"/root" = {
|
||||
mountpoint = "/";
|
||||
};
|
||||
"/persist" = {
|
||||
mountOptions = [ "subvol=persist" "noatime" ];
|
||||
mountpoint = "/persist";
|
||||
};
|
||||
"/nix" = {
|
||||
mountOptions = [ "subvol=nix" "noatime" ];
|
||||
mountpoint = "/nix";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -1,48 +0,0 @@
|
||||
{ config, lib, ... }: {
|
||||
|
||||
options.sysconfig.opts.devices.bonus = lib.mkOption {
|
||||
type = lib.types.attrsOf lib.types.str;
|
||||
default = null;
|
||||
};
|
||||
|
||||
config = lib.mkIf (config.disko.enable && config.sysconfig.opts.devices.bonus != null) {
|
||||
disko.devices = {
|
||||
disk = builtins.mapAttrs (name: device: {
|
||||
inherit device;
|
||||
type = "disk";
|
||||
content = {
|
||||
type = "gpt";
|
||||
partitions = {
|
||||
${name} = {
|
||||
name = "${name}";
|
||||
size = "100%";
|
||||
content = {
|
||||
type = "lvm_pv";
|
||||
vg = "$name_vg";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}) config.sysconfig.opts.devices.bonus;
|
||||
|
||||
lvm_vg = builtins.mapAttrs (name: device: {
|
||||
type = "lvm_vg";
|
||||
lvs = {
|
||||
${name} = {
|
||||
size = "100%FREE";
|
||||
content = {
|
||||
type = "btrfs";
|
||||
extraArgs = [ "-f" ];
|
||||
subvolumes = {
|
||||
"/${name}" = {
|
||||
mountOptions = [ "subvol=${name}" "noatime" ];
|
||||
mountpoint = "/${name}";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}) config.sysconfig.opts.devices.bonus;
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
{
|
||||
description = "disko config";
|
||||
|
||||
inputs = {
|
||||
nixpkgs.url = "github:nixos/nixpkgs/nixos-24.05";
|
||||
disko.url = "github:nix-community/disko";
|
||||
disko.inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
outputs = { self, ... }@inputs: {
|
||||
|
||||
module = { config, lib, pkgs, ... }: {
|
||||
imports = [
|
||||
(import ./default.nix { inherit config lib pkgs; })
|
||||
inputs.disko.nixosModules.default
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -1,30 +0,0 @@
|
||||
{ config, lib, ... }: {
|
||||
|
||||
config = lib.mkIf config.disko.impermanent {
|
||||
boot.initrd.postDeviceCommands = lib.mkAfter ''
|
||||
mkdir /btrfs_tmp
|
||||
mount /dev/root_vg/root /btrfs_tmp
|
||||
if [[ -e /btrfs_tmp/root ]]; then
|
||||
mkdir -p /btrfs_tmp/old_roots
|
||||
timestamp=$(date --date="@$(stat -c %Y /btrfs_tmp/root)" "+%Y-%m-%d_%H:%M:%S")
|
||||
mv /btrfs_tmp/root "btrfs_tmp/old_roots/$timestamp"
|
||||
fi
|
||||
|
||||
deleteSubvolumeRecursively() {
|
||||
IFS=$'\n'
|
||||
for i in $(btrfs subvolume list -o "$1" | cut -f 9- -d ' '); do
|
||||
deleteSubvolumeRecursively "/btrfs_tmp/$i"
|
||||
done;
|
||||
btrfs subvolume delete $1
|
||||
}
|
||||
|
||||
for i in $(find /btrfs_tmp/old_roots -maxdepth 1 -mtime +30); do
|
||||
deleteSubvolumeRecursively "$i"
|
||||
done
|
||||
|
||||
btrfs subvolume create /btrfs_tmp/root
|
||||
umount /btrfs_tmp
|
||||
'';
|
||||
|
||||
};
|
||||
}
|
||||
@@ -1,37 +0,0 @@
|
||||
{ config, lib, core_inputs, ... }: {
|
||||
|
||||
options.sysconfig.opts.firstBoot = lib.options.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = false;
|
||||
};
|
||||
|
||||
config = lib.mkIf config.sysconfig.opts.firstBoot {
|
||||
|
||||
users.users.${config.sysconfig.opts.username} = {
|
||||
initialPassword = "7567";
|
||||
openssh.authorizedKeys.keys = [
|
||||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAsU69CxfQk58CvItPN426h5Alnpb60SH37wet97Vb57 nathan@laptop"
|
||||
];
|
||||
};
|
||||
|
||||
home-manager.users.${config.sysconfig.opts.username} = core_inputs.${config.sysconfig.opts.username}.homeManagerModule;
|
||||
|
||||
systemd.services.sshd.wantedBy = lib.mkForce [ "multi-user.target" ];
|
||||
|
||||
systemd.services.onFirstBoot = {
|
||||
#name = "first-boot.service";
|
||||
|
||||
description = "actions to perform on the very first boot of the system";
|
||||
|
||||
enable = true;
|
||||
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
|
||||
script = ''
|
||||
setWallpaper /home/nathan/Pictures/Wallpaper/orangescape.jpg 70
|
||||
'';
|
||||
};
|
||||
|
||||
sysconfig.opts.openssh.enable = lib.mkForce true;
|
||||
};
|
||||
}
|
||||
@@ -1,73 +0,0 @@
|
||||
{
|
||||
description = "Unified System Configuration";
|
||||
|
||||
inputs = {
|
||||
|
||||
srvcs.url = "./services";
|
||||
|
||||
pckgs.url = "./packages";
|
||||
|
||||
prgms.url = "./programs";
|
||||
|
||||
nixpkgs.url = "github:nixos/nixpkgs/nixos-24.05";
|
||||
disko.url = "github:nix-community/disko";
|
||||
disko.inputs.nixpkgs.follows = "nixpkgs";
|
||||
|
||||
impermanence.url = "github:nix-community/impermanence";
|
||||
|
||||
};
|
||||
|
||||
outputs = { self, ... }@inputs: {
|
||||
|
||||
nixosModule = { config, lib, pkgs, core_inputs, ... }: {
|
||||
imports = [
|
||||
./configuration
|
||||
# ./configuration/${core_inputs.host}/hardware-configuration.nix
|
||||
./disko
|
||||
inputs.disko.nixosModules.default
|
||||
./impermanence
|
||||
inputs.impermanence.nixosModules.impermanence
|
||||
inputs.srvcs.module
|
||||
inputs.pckgs.module
|
||||
inputs.prgms.module
|
||||
./first_boot
|
||||
];
|
||||
|
||||
options = {
|
||||
sysconfig.opts = {
|
||||
host = lib.options.mkOption {
|
||||
type = lib.types.str;
|
||||
default = null;
|
||||
};
|
||||
username = lib.options.mkOption {
|
||||
type = lib.types.str;
|
||||
default = "nathan";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = {
|
||||
|
||||
assertions = [
|
||||
{
|
||||
assertion = (config.sysconfig.opts.host != null);
|
||||
message = "host cannot be null";
|
||||
}
|
||||
|
||||
{
|
||||
assertion = (config.sysconfig.opts.devices.main != null);
|
||||
message = "devices.main cannot be null";
|
||||
}
|
||||
];
|
||||
|
||||
networking.hostName = lib.mkDefault config.sysconfig.opts.host;
|
||||
|
||||
#users.users.${config.sysconfig.opts.username} = {
|
||||
|
||||
#};
|
||||
};
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
@@ -1,39 +0,0 @@
|
||||
# Do not modify this file! It was generated by ‘nixos-generate-config’
|
||||
# and may be overwritten by future invocations. Please make changes
|
||||
# to /etc/nixos/configuration.nix instead.
|
||||
{ config, lib, pkgs, modulesPath, ... }:
|
||||
|
||||
{
|
||||
imports =
|
||||
[ (modulesPath + "/installer/scan/not-detected.nix")
|
||||
];
|
||||
|
||||
boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" ];
|
||||
boot.initrd.kernelModules = [ ];
|
||||
boot.kernelModules = [ "kvm-amd" ];
|
||||
boot.extraModulePackages = [ ];
|
||||
|
||||
fileSystems."/" =
|
||||
{ device = "/dev/disk/by-uuid/efe05fe7-563d-411a-954b-317a2e7316f3";
|
||||
fsType = "ext4";
|
||||
};
|
||||
|
||||
fileSystems."/boot" =
|
||||
{ device = "/dev/disk/by-uuid/78F7-FFB8";
|
||||
fsType = "vfat";
|
||||
options = [ "fmask=0022" "dmask=0022" ];
|
||||
};
|
||||
|
||||
swapDevices = [ ];
|
||||
|
||||
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
|
||||
# (the default) this is the recommended approach. When using systemd-networkd it's
|
||||
# still possible to use this option, but it's recommended to use it in conjunction
|
||||
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
|
||||
networking.useDHCP = lib.mkDefault true;
|
||||
# networking.interfaces.enp6s0.useDHCP = lib.mkDefault true;
|
||||
# networking.interfaces.wlp7s0.useDHCP = lib.mkDefault true;
|
||||
|
||||
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
||||
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
{ config, lib, ... }: {
|
||||
|
||||
|
||||
config = lib.mkIf config.disko.impermanent {
|
||||
|
||||
fileSystems."/persist".neededForBoot = true;
|
||||
environment.persistence = {
|
||||
"/persist/system" = {
|
||||
hideMounts = true;
|
||||
directories = [
|
||||
"/etc/nixos"
|
||||
"/etc/shadow"
|
||||
"/var/log"
|
||||
"/var/lib/bluetooth"
|
||||
"/var/lib/nixos"
|
||||
"/var/lib/systemd/coredump"
|
||||
"/etc/NetworkManager/system-connections"
|
||||
];
|
||||
files = [
|
||||
"/etc/machine-id"
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
programs.fuse.userAllowOther = true;
|
||||
};
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
{
|
||||
description = "nix impermanence config";
|
||||
|
||||
inputs.impermanence.url = "github:nix-community/impermanence";
|
||||
|
||||
outputs = { self, ... }: {
|
||||
|
||||
module = { config, lib, ... }: import ./. { inherit config lib self; };
|
||||
};
|
||||
}
|
||||
21
system/packages/external/flake.nix
vendored
21
system/packages/external/flake.nix
vendored
@@ -1,21 +0,0 @@
|
||||
{
|
||||
description = "System External Flakes";
|
||||
|
||||
inputs = {
|
||||
|
||||
waveforms.url = "github:liff/waveforms-flake";
|
||||
|
||||
};
|
||||
|
||||
outputs = { self, ... }@inputs: {
|
||||
|
||||
module = { config, lib, pkgs, ... }: {
|
||||
|
||||
imports = [
|
||||
inputs.waveforms.nixosModule
|
||||
];
|
||||
|
||||
};
|
||||
|
||||
};
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
{
|
||||
description = "System packages";
|
||||
|
||||
inputs = {
|
||||
external.url = "./external";
|
||||
};
|
||||
|
||||
outputs = { self, ... }@inputs: {
|
||||
|
||||
module = { config, lib, pkgs, ... }: {
|
||||
imports = [
|
||||
inputs.external.module
|
||||
];
|
||||
};
|
||||
|
||||
};
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
{
|
||||
description = "System scripts";
|
||||
|
||||
inputs = {
|
||||
};
|
||||
|
||||
outputs = { self, ... }: {
|
||||
|
||||
module = { config, lib, pkgs, ... }: {};
|
||||
|
||||
};
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
{
|
||||
description = "ags dependancies";
|
||||
|
||||
inputs = {
|
||||
|
||||
};
|
||||
|
||||
outputs = { self, ... }: {
|
||||
|
||||
module = { config, lib, pkgs, ... }: {
|
||||
|
||||
options.sysconfig.opts.ags.enable = lib.options.mkOption {};
|
||||
|
||||
config = lib.mkIf config.sysconfig.opts.ags.enable {
|
||||
services = {
|
||||
upower.enable = true;
|
||||
gvfs.enable = true;
|
||||
power-profiles-daemon.enable = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
};
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
{
|
||||
description = "System program config";
|
||||
|
||||
inputs = {
|
||||
|
||||
ags.url = "./ags";
|
||||
|
||||
hyprland.url = "./hyprland";
|
||||
};
|
||||
|
||||
outputs = { self, ... }@inputs: {
|
||||
|
||||
module = { config, lib, pkgs, ... }: {
|
||||
|
||||
imports = [
|
||||
inputs.hyprland.module
|
||||
inputs.ags.module
|
||||
./git
|
||||
./nh
|
||||
./steam
|
||||
];
|
||||
};
|
||||
|
||||
};
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
{ config, lib, ... }: {
|
||||
|
||||
options.sysconfig.opts.git.enable = lib.options.mkOption {};
|
||||
|
||||
config = lib.mkIf config.sysconfig.opts.git.enable {
|
||||
|
||||
programs.git = {
|
||||
enable = true;
|
||||
config = {
|
||||
user = {
|
||||
name = "blaknull";
|
||||
email = "nathanblunkall5@gmail.com";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -1,35 +0,0 @@
|
||||
{
|
||||
description = "Hyprland Config";
|
||||
|
||||
inputs = {
|
||||
hyprland.url = "git+https://github.com/hyprwm/Hyprland?submodules=1";
|
||||
};
|
||||
|
||||
outputs = { self, ... }@inputs: {
|
||||
|
||||
module = { config, lib, pkgs, ... }: {
|
||||
|
||||
options.sysconfig.opts.hyprland.enable = lib.options.mkOption {};
|
||||
|
||||
config = lib.mkIf config.sysconfig.opts.hyprland.enable {
|
||||
|
||||
sysconfig.opts.sddm.enable = lib.mkDefault true;
|
||||
|
||||
environment.sessionVariables.NIXOS_OZONE_WL = "1";
|
||||
|
||||
programs.hyprland = {
|
||||
enable = true;
|
||||
|
||||
xwayland.enable = true;
|
||||
|
||||
package = inputs.hyprland.packages.${pkgs.stdenv.hostPlatform.system}.hyprland;
|
||||
|
||||
portalPackage = inputs.hyprland.packages.${pkgs.stdenv.hostPlatform.system}.xdg-desktop-portal-hyprland;
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
};
|
||||
|
||||
};
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
{ config, lib, ... }: {
|
||||
|
||||
options.sysconfig.opts.nh.enable = lib.options.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = false;
|
||||
};
|
||||
|
||||
config = lib.mkIf config.sysconfig.opts.nh.enable {
|
||||
|
||||
programs.nh = {
|
||||
enable = true;
|
||||
flake = "/home/nathan/Projects/System";
|
||||
|
||||
clean = {
|
||||
enable = true;
|
||||
dates = "weekly";
|
||||
extraArgs = "--keep 5 --keep-since 3d";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
{ config, lib, ... }: {
|
||||
|
||||
options.sysconfig.opts.steam.enable = lib.options.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = false;
|
||||
};
|
||||
|
||||
config = lib.mkIf config.sysconfig.opts.steam.enable {
|
||||
|
||||
programs.steam = {
|
||||
enable = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
{
|
||||
description = "System service config";
|
||||
|
||||
inputs = {
|
||||
|
||||
sddm.url = "./sddm";
|
||||
};
|
||||
|
||||
outputs = { self, ... }@inputs: {
|
||||
|
||||
module = { config, lib, pkgs, ... }: {
|
||||
imports = [
|
||||
inputs.sddm.module
|
||||
./openssh
|
||||
./ollama
|
||||
./pipewire
|
||||
];
|
||||
};
|
||||
|
||||
};
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
{ config, lib, ... }: {
|
||||
|
||||
options = {
|
||||
sysconfig.opts.ollama.enable = lib.options.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = false;
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf config.sysconfig.opts.ollama.enable {
|
||||
services.ollama = {
|
||||
enable = true;
|
||||
acceleration = "cuda";
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
{ config, lib, ... }: {
|
||||
|
||||
options = {
|
||||
sysconfig.opts.openssh.enable = lib.options.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = false;
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf config.sysconfig.opts.openssh.enable {
|
||||
|
||||
networking.firewall.allowedTCPPorts = [ 22 ];
|
||||
|
||||
services.openssh = {
|
||||
enable = true;
|
||||
settings = {
|
||||
PermitRootLogin = lib.mkForce "no";
|
||||
PasswordAuthentication = false;
|
||||
KbdInteractiveAuthentication = false;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -1,51 +0,0 @@
|
||||
{ config, lib, pkgs, ... }: {
|
||||
|
||||
options = {
|
||||
sysconfig.opts.pipewire.enable = lib.options.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = false;
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf config.sysconfig.opts.pipewire.enable {
|
||||
|
||||
# Enable sound with pipewire.
|
||||
sound.enable = true;
|
||||
|
||||
security.rtkit.enable = true;
|
||||
services.pipewire = {
|
||||
enable = true;
|
||||
package = pkgs.pipewire;
|
||||
alsa.enable = true;
|
||||
alsa.support32Bit = true;
|
||||
pulse.enable = true;
|
||||
extraConfig.pipewire-pulse."92-low-latency" = {
|
||||
context.modules = [
|
||||
{
|
||||
name = "libpipewire-module-protocol-pulse";
|
||||
args = {
|
||||
pulse.min.req = "32/48000";
|
||||
pulse.default.req = "32/48000";
|
||||
pulse.max.req = "32/48000";
|
||||
pulse.min.quantum = "32/48000";
|
||||
pulse.max.quantum = "32/48000";
|
||||
};
|
||||
}
|
||||
];
|
||||
stream.properties = {
|
||||
node.latency = "32/48000";
|
||||
resample.quality = 1;
|
||||
};
|
||||
};
|
||||
# If you want to use JACK applications, uncomment this
|
||||
#jack.enable = true;
|
||||
|
||||
# use the example session manager (no others are packaged yet so this is enabled by default,
|
||||
# no need to redefine it in your config for now)
|
||||
wireplumber.enable = true;
|
||||
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
}
|
||||
@@ -1,45 +0,0 @@
|
||||
{
|
||||
description = "sddm config";
|
||||
|
||||
inputs = {
|
||||
|
||||
theme.url = "./themes/tokyo-night";
|
||||
|
||||
};
|
||||
|
||||
outputs = { self, ... }@inputs: {
|
||||
|
||||
module = { config, lib, pkgs, ... }: {
|
||||
|
||||
options.sysconfig.opts.sddm.enable = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = false;
|
||||
};
|
||||
|
||||
config = lib.mkIf config.sysconfig.opts.sddm.enable {
|
||||
|
||||
qt.enable = true;
|
||||
|
||||
services.displayManager.sddm = {
|
||||
enable = true;
|
||||
wayland.enable = true;
|
||||
autoNumlock = true;
|
||||
theme = "${inputs.theme.theme { inherit pkgs; }}";
|
||||
enableHidpi = true;
|
||||
extraPackages = with pkgs; [
|
||||
libsForQt5.qtsvg
|
||||
libsForQt5.qtquickcontrols2
|
||||
libsForQt5.qtgraphicaleffects
|
||||
];
|
||||
settings = {
|
||||
Autologin = {
|
||||
User = "nathan";
|
||||
Session = "hyprland";
|
||||
Relogin = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -1,29 +0,0 @@
|
||||
{
|
||||
description = "Package Sugar Dark SDDM theme";
|
||||
|
||||
inputs = {
|
||||
|
||||
repo = {
|
||||
url = "github:MarianArlt/sddm-sugar-dark";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
outputs = { self, repo, ... }: {
|
||||
|
||||
theme = { pkgs }: pkgs.stdenv.mkDerivation {
|
||||
|
||||
name = "sugar-dark";
|
||||
|
||||
src = repo;
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p $out
|
||||
cp -R $src/* $out/
|
||||
'';
|
||||
|
||||
};
|
||||
|
||||
};
|
||||
}
|
||||
@@ -1,29 +0,0 @@
|
||||
{
|
||||
description = "Package Tokyo Night SDDM theme";
|
||||
|
||||
inputs = {
|
||||
|
||||
repo = {
|
||||
url = "github:siddrs/tokyo-night-sddm";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
outputs = { self, repo, ... }: {
|
||||
|
||||
theme = { pkgs }: pkgs.stdenv.mkDerivation {
|
||||
|
||||
name = "tokyo-night";
|
||||
|
||||
src = repo;
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p $out
|
||||
cp -R $src/* $out/
|
||||
'';
|
||||
|
||||
};
|
||||
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user