diff --git a/flake.lock b/flake.lock index 60952a7..d9e66a0 100644 --- a/flake.lock +++ b/flake.lock @@ -5,11 +5,11 @@ "nixpkgs": "nixpkgs" }, "locked": { - "lastModified": 1710379155, - "narHash": "sha256-zdHEsOOnfBTO1ymL6gd9etR+iNS6HowbJM4Llqxy+Uc=", + "lastModified": 1711261295, + "narHash": "sha256-5DUNQl9BSmLxgGLbF05G7hi/UTk9DyZq8AuEszhQA7Q=", "owner": "nix-community", "repo": "disko", - "rev": "cc69c2340b59e290982ec7e6238471d470c839d0", + "rev": "5d2d3e421ade554b19b4dbb0d11a04023378a330", "type": "github" }, "original": { @@ -59,11 +59,11 @@ ] }, "locked": { - "lastModified": 1710349883, - "narHash": "sha256-bjbdS2mC76xNJwt1d/uZa+JdHR8CCyYbF4Ey/NgOJus=", + "lastModified": 1711133180, + "narHash": "sha256-WJOahf+6115+GMl3wUfURu8fszuNeJLv9qAWFQl3Vmo=", "owner": "nix-community", "repo": "home-manager", - "rev": "2f0db7d418e781354d8a3c50e611e3b1cd413087", + "rev": "1c2c5e4cabba4c43504ef0f8cc3f3dfa284e2dbb", "type": "github" }, "original": { @@ -80,11 +80,11 @@ ] }, "locked": { - "lastModified": 1706981411, - "narHash": "sha256-cLbLPTL1CDmETVh4p0nQtvoF+FSEjsnJTFpTxhXywhQ=", + "lastModified": 1710888565, + "narHash": "sha256-s9Hi4RHhc6yut4EcYD50sZWRDKsugBJHSbON8KFwoTw=", "owner": "nix-community", "repo": "home-manager", - "rev": "652fda4ca6dafeb090943422c34ae9145787af37", + "rev": "f33900124c23c4eca5831b9b5eb32ea5894375ce", "type": "github" }, "original": { @@ -118,11 +118,11 @@ "nixpkgs-regression": "nixpkgs-regression" }, "locked": { - "lastModified": 1710366336, - "narHash": "sha256-eJeZ3vMbuC351B6CH4mqcpuZJ9RgtdRcxvhd7X2++Nk=", + "lastModified": 1711387640, + "narHash": "sha256-P6Zg/xDfXZ1QiZ7Cssb66n7Dn2m4MVdFs0uOfajQaEI=", "owner": "NixOS", "repo": "nix", - "rev": "c152c2767a262b772c912287e1c2d85173b4781c", + "rev": "290072ca1e483289c65ff4da23c22b5b2ffced06", "type": "github" }, "original": { @@ -132,11 +132,11 @@ }, "nixos-hardware": { "locked": { - "lastModified": 1710123225, - "narHash": "sha256-j3oWlxRZxB7cFsgEntpH3rosjFHRkAo/dhX9H3OfxtY=", + "lastModified": 1711352745, + "narHash": "sha256-luvqik+i3HTvCbXQZgB6uggvEcxI9uae0nmrgtXJ17U=", "owner": "NixOS", "repo": "nixos-hardware", - "rev": "ad2fd7b978d5e462048729a6c635c45d3d33c9ba", + "rev": "9a763a7acc4cfbb8603bb0231fec3eda864f81c0", "type": "github" }, "original": { @@ -148,11 +148,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1710346304, - "narHash": "sha256-vwoyBoCovK7+vdbCYqL9MssoFQjaXtZN8sElcjUdbx8=", + "lastModified": 1710889954, + "narHash": "sha256-Pr6F5Pmd7JnNEMHHmspZ0qVqIBVxyZ13ik1pJtm2QXk=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "a0906f14161a5c5792e9883117b9471f5bf6df72", + "rev": "7872526e9c5332274ea5932a0c3270d6e4724f3b", "type": "github" }, "original": { @@ -230,11 +230,11 @@ }, "nixpkgs_3": { "locked": { - "lastModified": 1710272261, - "narHash": "sha256-g0bDwXFmTE7uGDOs9HcJsfLFhH7fOsASbAuOzDC+fhQ=", + "lastModified": 1711163522, + "narHash": "sha256-YN/Ciidm+A0fmJPWlHBGvVkcarYWSC+s3NTPk/P+q3c=", "owner": "nixos", "repo": "nixpkgs", - "rev": "0ad13a6833440b8e238947e47bea7f11071dc2b2", + "rev": "44d0940ea560dee511026a53f0e2e2cde489b4d4", "type": "github" }, "original": { @@ -299,11 +299,11 @@ "treefmt-nix": "treefmt-nix" }, "locked": { - "lastModified": 1707783103, - "narHash": "sha256-VOP1VOeXOyjn+AJfSHzVNT0l+rgm63ev9p4uTfMfYY0=", + "lastModified": 1711238766, + "narHash": "sha256-pHTIzcmvB66Jwbkl8LtoYVP8+mRiUwT3D29onLdx+gM=", "owner": "rafaelrc7", "repo": "wayland-pipewire-idle-inhibit", - "rev": "328da9a7ec30648666434e05cdea614c54f71b46", + "rev": "7737d3d2f083dd6bb37882e71b974170f858720e", "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/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/sway.nix b/home/gui/sway.nix index d28b89d..fb9cbfd 100644 --- a/home/gui/sway.nix +++ b/home/gui/sway.nix @@ -1,7 +1,7 @@ -{ inputs, config, ... }: +{ inputs, outputs, ... }: { - xdg.configFile."sway/config".source = files/sway/${host}; - # xdg.configFile."sway/config".source = files/sway/default; + # xdg.configFile."sway/config".source = files/sway/${inputs.networking.hostName}; + xdg.configFile."sway/config".source = files/sway/default; programs.swaylock = { enable = true; settings = { diff --git a/hosts/loki/default.nix b/hosts/loki/default.nix index c00c8f0..2c9c7f4 100644 --- a/hosts/loki/default.nix +++ b/hosts/loki/default.nix @@ -1,4 +1,4 @@ -{ config, pkgs, ... }: +{ inputs, outputs, ... }: { imports =