diff --git a/.gitattributes b/.gitattributes index 66b07a4..2138631 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,3 +1,2 @@ hosts/*/*key filter=git-crypt diff=git-crypt -workstation/tailscale.nix filter=git-crypt diff=git-crypt -server/tailscale.nix filter=git-crypt diff=git-crypt +hosts/*/tailscale.nix filter=git-crypt diff=git-crypt diff --git a/TODO.md b/TODO.md deleted file mode 100644 index 47c175c..0000000 --- a/TODO.md +++ /dev/null @@ -1,58 +0,0 @@ -# TODO - -## Machine types -- [ ] add HP 810RG1 profile -- [ ] add ssd to all -- [x] fix eve???? - -## Home-manager - -### To Import -- [ ] aspell.en.prepl -- [ ] aspell.en.pws -- [ ] mbsyncrc -- [ ] neomutt -- [ ] vdirsyncer - -### Port/import -- [x] All_Regions -- [x] TrusteRegion -- [x] Unknown_Region -- [x] UntrusteRegion -- [x] appsrv -- [x] authy -- [x] bash_aliases -- [x] bash_functions -- [x] bash_hosts -- [x] bash_logout -- [x] bash_motd -- [x] bash_motownscript -- [x] bash_profile -- [x] bash_ssh -- [x] bashrc -- [x] config-waybar -- [x] gitconfig -- [x] gnupg -- [x] inputrc -- [x] listadmin.ini -- [x] local -- [x] myapps -- [x] notmuch -- [x] qutebrowser -- [x] signature -- [x] sway -- [x] swaylock -- [x] task -- [x] tigrc -- [x] tmux-cssh -- [x] tmux.conf -- [x] tmuxinator -- [x] urlview -- [x] vit -- [x] wfclient - -### Drop -- muttprintrc -- pw.gpg -- slack -- token diff --git a/flake.lock b/flake.lock index 02e1027..cd9e66b 100644 --- a/flake.lock +++ b/flake.lock @@ -5,11 +5,11 @@ "nixpkgs": "nixpkgs" }, "locked": { - "lastModified": 1711462743, - "narHash": "sha256-3wKGpHy9Kyh98DrziqC/s//60Q0pE17NgbY93L0uWng=", + "lastModified": 1711588700, + "narHash": "sha256-vBB5HoQVnA6c/UrDOhLXKAahEwSRccw2YXYHxD7qoi4=", "owner": "nix-community", "repo": "disko", - "rev": "a6717b1afee7ae955c61eefdf0ce8f864ef78115", + "rev": "502241afa3de2a24865ddcbe4c122f4546e32092", "type": "github" }, "original": { @@ -59,11 +59,11 @@ ] }, "locked": { - "lastModified": 1711133180, - "narHash": "sha256-WJOahf+6115+GMl3wUfURu8fszuNeJLv9qAWFQl3Vmo=", + "lastModified": 1711625603, + "narHash": "sha256-W+9dfqA9bqUIBV5u7jaIARAzMe3kTq/Hp2SpSVXKRQw=", "owner": "nix-community", "repo": "home-manager", - "rev": "1c2c5e4cabba4c43504ef0f8cc3f3dfa284e2dbb", + "rev": "c0ef0dab55611c676ad7539bf4e41b3ec6fa87d2", "type": "github" }, "original": { @@ -118,11 +118,11 @@ "nixpkgs-regression": "nixpkgs-regression" }, "locked": { - "lastModified": 1711457510, - "narHash": "sha256-jUs32BtsymXL7nUgPmJ7WG8LlL+HkUJKNZ1dsrGQ+lA=", + "lastModified": 1711652043, + "narHash": "sha256-WlV3UBcv0hStLqKrNEsNqrOtTPQlzEjVbGt38XytOlo=", "owner": "NixOS", "repo": "nix", - "rev": "6c10cc0edabdbbdbf11ce0b388f88325c9958792", + "rev": "ef26133df309fcadb552467ba45a8f170e78d7ad", "type": "github" }, "original": { @@ -148,11 +148,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1710889954, - "narHash": "sha256-Pr6F5Pmd7JnNEMHHmspZ0qVqIBVxyZ13ik1pJtm2QXk=", + "lastModified": 1711401922, + "narHash": "sha256-QoQqXoj8ClGo0sqD/qWKFWezgEwUL0SUh37/vY2jNhc=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "7872526e9c5332274ea5932a0c3270d6e4724f3b", + "rev": "07262b18b97000d16a4bdb003418bd2fb067a932", "type": "github" }, "original": { @@ -230,11 +230,11 @@ }, "nixpkgs_3": { "locked": { - "lastModified": 1711333969, - "narHash": "sha256-5PiWGn10DQjMZee5NXzeA6ccsv60iLu+Xtw+mfvkUAs=", + "lastModified": 1711523803, + "narHash": "sha256-UKcYiHWHQynzj6CN/vTcix4yd1eCu1uFdsuarupdCQQ=", "owner": "nixos", "repo": "nixpkgs", - "rev": "57e6b3a9e4ebec5aa121188301f04a6b8c354c9b", + "rev": "2726f127c15a4cc9810843b96cad73c7eb39e443", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index 7b822ee..86819d6 100644 --- a/flake.nix +++ b/flake.nix @@ -30,55 +30,91 @@ ... }: let - inputs = { inherit disko home-manager nixpkgs nixos-hardware wayland-pipewire-idle-inhibit; }; + inherit (self) outputs; + lib = nixpkgs.lib // home-manager.lib; + systems = [ "x86_64-linux" "aarch64-linux" ]; + forEachSystem = f: lib.genAttrs systems (system: f pkgsFor.${system}); + pkgsFor = lib.genAttrs systems (system: import nixpkgs { + inherit system; + config.allowUnfree = true; + }); + in + { + inherit lib; + nixosModules = import ./modules/nixos; + homeManagerModules = import ./modules/home-manager; + templates = import ./templates; - genPkgs = system: import nixpkgs { inherit system; config.allowUnfree = true; }; + overlays = import ./overlays { inherit inputs outputs; }; + hydraJobs = import ./hydra.nix { inherit inputs outputs; }; + + # packages = forEachSystem (pkgs: import ./pkgs { inherit pkgs; }); + # devShells = forEachSystem (pkgs: import ./shell.nix { inherit pkgs; }); + # formatter = forEachSystem (pkgs: pkgs.nixpkgs-fmt); - # creates a nixos system config - nixosSystem = system: hostname: username: - let - pkgs = genPkgs system; - in - nixpkgs.lib.nixosSystem { - inherit system; - specialArgs = { - inherit pkgs; - # lets us use these things in modules - customArgs = { inherit system hostname username pkgs; }; - }; - modules = [ - #disko.nixosModules.disko - ./hosts/${hostname} - home-manager.nixosModules.home-manager { - networking.hostName = hostname; - home-manager.useGlobalPkgs = true; - home-manager.useUserPackages = true; - #home-manager.users.${username} = { imports = [ ./home/${username}.nix ]; }; - } - ]; - }; - in { nixosConfigurations = { # clients - ace = nixosSystem "x86_64-linux" "ace" "don"; - dragon = nixosSystem "x86_64-linux" "dragon" "don"; - eve = nixosSystem "x86_64-linux" "eve" "don"; - loki = nixosSystem "x86_64-linux" "loki" "don"; - pocket2 = nixosSystem "x86_64-linux" "pocket2" "don"; - smaug = nixosSystem "x86_64-linux" "smaug" "don"; - #t2 = nixosSystem "x86_64-linux" "t2" "don"; + ace = lib.nixosSystem { + modules = [ ./hosts/ace ]; + specialArgs = { inherit inputs outputs; }; + }; + dragon = lib.nixosSystem { + modules = [ ./hosts/dragon ]; + specialArgs = { inherit inputs outputs; }; + }; + eve = lib.nixosSystem { + modules = [ ./hosts/eve ]; + specialArgs = { inherit inputs outputs; }; + }; + loki = lib.nixosSystem { + modules = [ ./hosts/loki ]; + specialArgs = { inherit inputs outputs; }; + }; + pocket2 = lib.nixosSystem { + modules = [ ./hosts/pocket2 ]; + specialArgs = { inherit inputs outputs; }; + }; + smaug = lib.nixosSystem { + modules = [ ./hosts/smaug ]; + specialArgs = { inherit inputs outputs; }; + }; + # t2 = lib.nixosSystem { + # modules = [ ./hosts/t2 ]; + # specialArgs = { inherit inputs outputs; }; + # }; # servers - display = nixosSystem "x86_64-linux" "display" "don"; - harper2 = nixosSystem "x86_64-linux" "harper2" "don"; - harper = nixosSystem "x86_64-linux" "harper" "don"; - nuwww = nixosSystem "x86_64-linux" "nuwww" "don"; - pihole = nixosSystem "x86_64-linux" "pihole" "don"; - www2 = nixosSystem "x86_64-linux" "www2" "don"; + display = lib.nixosSystem { + modules = [ ./hosts/display ]; + specialArgs = { inherit inputs outputs; }; + }; + harper2 = lib.nixosSystem { + modules = [ ./hosts/harper2 ]; + specialArgs = { inherit inputs outputs; }; + }; + harper = lib.nixosSystem { + modules = [ ./hosts/harper ]; + specialArgs = { inherit inputs outputs; }; + }; + nuwww = lib.nixosSystem { + modules = [ ./hosts/nuwww ]; + specialArgs = { inherit inputs outputs; }; + }; + pihole = lib.nixosSystem { + modules = [ ./hosts/pihole ]; + specialArgs = { inherit inputs outputs; }; + }; + www2 = lib.nixosSystem { + modules = [ ./hosts/www2 ]; + specialArgs = { inherit inputs outputs; }; + }; # test system # use this for a blank ISO + disko to work - nixos = nixosSystem "x86_64-linux" "nixos" "don"; + nixos = lib.nixosSystem { + modules = [ ./hosts/nixos ]; + specialArgs = { inherit inputs outputs; }; + }; }; }; } diff --git a/home/common/taskwarrior.nix b/home/common/taskwarrior.nix index 164afcf..f7ea0a2 100644 --- a/home/common/taskwarrior.nix +++ b/home/common/taskwarrior.nix @@ -1,6 +1,6 @@ { pkgs, ... }: { - home.packages = with pkgs; [ taskwarrior tasksh vit timewarrior ]; + home.packages = with pkgs; [ taskwarrior taskwarrior-tui tasksh vit timewarrior ]; programs.taskwarrior = { enable = true; colorTheme = "dark-green-256"; diff --git a/home/common/topgrade.nix b/home/common/topgrade.nix index b4e85c9..0446317 100644 --- a/home/common/topgrade.nix +++ b/home/common/topgrade.nix @@ -3,10 +3,6 @@ programs.topgrade = { enable = true; settings = { - linux = { - home_manager_arguments = [ "--flake" ]; - nix_arguments = "--flake"; - }; misc = { assume_yes = true; no_retry = true; diff --git a/home/default.nix b/home/default.nix index afcc615..a86309d 100644 --- a/home/default.nix +++ b/home/default.nix @@ -1,6 +1,8 @@ -{ ... }: +{ inputs, outputs, ... }: { + imports = [ inputs.home-manager.nixosModules.home-manager ]; + home-manager.extraSpecialArgs = { inherit inputs outputs; }; home-manager = { useGlobalPkgs = true; useUserPackages = true; diff --git a/home/gui/default.nix b/home/gui/default.nix index 0a1620d..1080b35 100644 --- a/home/gui/default.nix +++ b/home/gui/default.nix @@ -52,7 +52,7 @@ poweralertd powerline-fonts prusa-slicer - # pwvucontrol # FIXME Build errors 2024-03-26 + # pwvucontrol ## TODO FIXME This is currently broken upstream 2024-03-26 qpwgraph quickemu quickgui diff --git a/home/gui/sway.nix b/home/gui/sway.nix index c650a7f..fb9cbfd 100644 --- a/home/gui/sway.nix +++ b/home/gui/sway.nix @@ -1,6 +1,6 @@ -{ ... }: +{ inputs, outputs, ... }: { - # xdg.configFile."sway/config".source = files/sway/${config.networking.hostName}; + # xdg.configFile."sway/config".source = files/sway/${inputs.networking.hostName}; xdg.configFile."sway/config".source = files/sway/default; programs.swaylock = { enable = true; diff --git a/hosts/ace/default.nix b/hosts/ace/default.nix index eaee1e9..162fe4c 100644 --- a/hosts/ace/default.nix +++ b/hosts/ace/default.nix @@ -4,10 +4,10 @@ imports = [ ./hardware-configuration.nix - ../../workstation + ../workstation ../../home ../../home/gui - ../../wm + ../wm ]; networking.hostName = "ace"; } diff --git a/hosts/dragon/default.nix b/hosts/dragon/default.nix index d4624cb..e15321b 100644 --- a/hosts/dragon/default.nix +++ b/hosts/dragon/default.nix @@ -8,10 +8,10 @@ #inputs.nixos-hardware.nixosModules.common-gpu-intel #inputs.nixos-hardware.nixosModules.common-pc-laptop #inputs.nixos-hardware.nixosModules.common-pc-laptop-ssd - ../../workstation + ../workstation ../../home ../../home/gui - ../../wm + ../wm ]; networking.hostName = "dragon"; } diff --git a/hosts/eve/default.nix b/hosts/eve/default.nix index 5a662bd..e9c909e 100644 --- a/hosts/eve/default.nix +++ b/hosts/eve/default.nix @@ -4,10 +4,10 @@ imports = [ ./hardware-configuration.nix - ../../workstation + ../workstation ../../home ../../home/gui - ../../wm + ../wm ]; networking.hostName = "eve"; } diff --git a/hosts/loki/default.nix b/hosts/loki/default.nix index 8e109ac..c34d83c 100644 --- a/hosts/loki/default.nix +++ b/hosts/loki/default.nix @@ -1,13 +1,14 @@ -{ config, pkgs, ... }: +{ inputs, outputs, ... }: { imports = [ ./hardware-configuration.nix - ../../workstation + ../workstation + ../workstation/kvm.nix ../../home ../../home/gui - ../../wm + ../wm ]; networking.hostName = "loki"; } diff --git a/hosts/pocket2/default.nix b/hosts/pocket2/default.nix index 6e8eb1c..74af50f 100644 --- a/hosts/pocket2/default.nix +++ b/hosts/pocket2/default.nix @@ -8,10 +8,10 @@ #inputs.nixos-hardware.nixosModules.common-gpu-intel #inputs.nixos-hardware.nixosModules.common-pc-laptop #inputs.nixos-hardware.nixosModules.common-pc-laptop-ssd - ../../workstation + ../workstation ../../home ../../home/gui - ../../wm + ../wm ]; networking.hostName = "pocket2"; } diff --git a/server/default.nix b/hosts/server/default.nix similarity index 100% rename from server/default.nix rename to hosts/server/default.nix diff --git a/server/systemd.nix b/hosts/server/systemd.nix similarity index 100% rename from server/systemd.nix rename to hosts/server/systemd.nix diff --git a/server/tailscale.nix b/hosts/server/tailscale.nix similarity index 100% rename from server/tailscale.nix rename to hosts/server/tailscale.nix diff --git a/server/upgrade-diff.nix b/hosts/server/upgrade-diff.nix similarity index 100% rename from server/upgrade-diff.nix rename to hosts/server/upgrade-diff.nix diff --git a/hosts/smaug/default.nix b/hosts/smaug/default.nix index d03e7aa..5bafa81 100644 --- a/hosts/smaug/default.nix +++ b/hosts/smaug/default.nix @@ -4,10 +4,10 @@ imports = [ ./hardware-configuration.nix - ../../workstation + ../workstation ../../home ../../home/gui - ../../wm + ../wm ]; networking.hostName = "smaug"; } diff --git a/hosts/t2/default.nix b/hosts/t2/default.nix index 57bd63a..49dfa5e 100644 --- a/hosts/t2/default.nix +++ b/hosts/t2/default.nix @@ -4,10 +4,10 @@ imports = [ ./hardware-configuration.nix - ../../workstation + ../workstation ../../home ../../home/gui - ../../wm + ../wm ]; networking.hostName = "t2"; } diff --git a/wm/default.nix b/hosts/wm/default.nix similarity index 100% rename from wm/default.nix rename to hosts/wm/default.nix diff --git a/wm/kde/default.nix b/hosts/wm/kde/default.nix similarity index 100% rename from wm/kde/default.nix rename to hosts/wm/kde/default.nix diff --git a/wm/sway/default.nix b/hosts/wm/sway/default.nix similarity index 100% rename from wm/sway/default.nix rename to hosts/wm/sway/default.nix diff --git a/workstation/default.nix b/hosts/workstation/default.nix similarity index 99% rename from workstation/default.nix rename to hosts/workstation/default.nix index d0c93b1..5dd394d 100644 --- a/workstation/default.nix +++ b/hosts/workstation/default.nix @@ -3,6 +3,7 @@ let my-python-packages = python-packages: with python-packages; [ pip + # pipx python-dateutil setuptools requests diff --git a/workstation/detect-reboot-needed.nix b/hosts/workstation/detect-reboot-needed.nix similarity index 100% rename from workstation/detect-reboot-needed.nix rename to hosts/workstation/detect-reboot-needed.nix diff --git a/hosts/workstation/kvm.nix b/hosts/workstation/kvm.nix new file mode 100644 index 0000000..d0cae6f --- /dev/null +++ b/hosts/workstation/kvm.nix @@ -0,0 +1,5 @@ +{ pkgs, inputs, ... }: +{ + virtualisation.libvirtd.enable = true; + environment.systemPackages = with pkgs; [ gnome.gnome-boxes ]; +} diff --git a/workstation/systemd.nix b/hosts/workstation/systemd.nix similarity index 100% rename from workstation/systemd.nix rename to hosts/workstation/systemd.nix diff --git a/workstation/tailscale.nix b/hosts/workstation/tailscale.nix similarity index 100% rename from workstation/tailscale.nix rename to hosts/workstation/tailscale.nix diff --git a/workstation/upgrade-diff.nix b/hosts/workstation/upgrade-diff.nix similarity index 100% rename from workstation/upgrade-diff.nix rename to hosts/workstation/upgrade-diff.nix diff --git a/makefile b/makefile index 65aab2c..c153085 100644 --- a/makefile +++ b/makefile @@ -3,7 +3,10 @@ UNAME_S := $(shell uname -s) UNAME_M := $(shell uname -m) all: - locate home-manager-backup | sort -u | xargs rm -f + @locate home-manager-backup | sort -u | xargs rm -f + doas nixos-rebuild build --flake .#${HOSTNAME} + +switch: doas nixos-rebuild switch --flake .#${HOSTNAME} weekly: pull clean update ci all push @@ -24,8 +27,8 @@ push: pull: @. ~/.bash_ssh git pull - doas nix-prefetch-url file://$$PWD/$$(ls -1 pkgs/linuxx64* | tail -n1) - doas nix-prefetch-url file://$$PWD/$$(ls -1 pkgs/linuxarm64* | tail -n1) + doas nix-prefetch-url file://$$PWD/$$(ls -1 src/linuxx64* | tail -n1) + doas nix-prefetch-url file://$$PWD/$$(ls -1 src/linuxarm64* | tail -n1) ci: diff --git a/mypackages/kanshi-fix/99-kanshi-fix.rules b/pkgs/kanshi-fix/99-kanshi-fix.rules similarity index 100% rename from mypackages/kanshi-fix/99-kanshi-fix.rules rename to pkgs/kanshi-fix/99-kanshi-fix.rules diff --git a/mypackages/kanshi-fix/default.nix b/pkgs/kanshi-fix/default.nix similarity index 100% rename from mypackages/kanshi-fix/default.nix rename to pkgs/kanshi-fix/default.nix diff --git a/mypackages/kanshi-fix/derivation.nix b/pkgs/kanshi-fix/derivation.nix similarity index 100% rename from mypackages/kanshi-fix/derivation.nix rename to pkgs/kanshi-fix/derivation.nix diff --git a/mypackages/kanshi-fix/kanshi-fix b/pkgs/kanshi-fix/kanshi-fix similarity index 100% rename from mypackages/kanshi-fix/kanshi-fix rename to pkgs/kanshi-fix/kanshi-fix diff --git a/pkgs/linuxarm64-23.9.0.24.tar.gz b/src/linuxarm64-23.9.0.24.tar.gz similarity index 100% rename from pkgs/linuxarm64-23.9.0.24.tar.gz rename to src/linuxarm64-23.9.0.24.tar.gz diff --git a/pkgs/linuxx64-23.11.0.82.tar.gz b/src/linuxx64-24.2.0.65.tar.gz similarity index 90% rename from pkgs/linuxx64-23.11.0.82.tar.gz rename to src/linuxx64-24.2.0.65.tar.gz index 5ae31d2..f856198 100644 Binary files a/pkgs/linuxx64-23.11.0.82.tar.gz and b/src/linuxx64-24.2.0.65.tar.gz differ diff --git a/user/don/config.nix b/user/don/config.nix deleted file mode 100644 index 7102dd8..0000000 --- a/user/don/config.nix +++ /dev/null @@ -1,3 +0,0 @@ -{ allowUnfree = true; - permittedInsecurePackages = [ "electron-18.1.0" ]; -} diff --git a/user/vicky/default.nix b/user/vicky/default.nix deleted file mode 100644 index dd8a5db..0000000 --- a/user/vicky/default.nix +++ /dev/null @@ -1,20 +0,0 @@ -{ config, pkgs, callPackage, ... }: -{ - - users.users.vicky = { - isNormalUser = true; - description = "Vicky Harper"; - extraGroups = [ "networkmanager" "wheel" "scanner" "lp" "video" "mlocate" ]; - openssh.authorizedKeys.keys = [ - "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINd8AdVbQQ/Fmw+b9mI8EMYqIoRkwmSwAOtmlte3incL don@loki" - ]; - }; - services.xserver = { - enable = true; - desktopManager = { - xterm.enable = false; - xfce.enable = true; - }; - displayManager.defaultSession = "xfce"; - }; -}