diff options
| author | Kleidi Bujari <mail@4kb.net> | 2026-10-24 22:52:35 -0700 |
|---|---|---|
| committer | Kleidi Bujari <mail@4kb.net> | 2026-10-24 22:59:09 -0700 |
| commit | 48c8a4145c5a73874797a6de3f05ce584b1d1798 (patch) | |
| tree | bd4c627e8c8944fb7082b7a9982e8d3677c2a2c4 /default.nix | |
| parent | 1a181be93f37a94b347b2f5f97a1fef57e11cf89 (diff) | |
| parent | 27db59cac4f3c3e7a1e4187a5f56d4ec61895c5a (diff) | |
| download | depot-48c8a4145c5a73874797a6de3f05ce584b1d1798.tar.gz depot-48c8a4145c5a73874797a6de3f05ce584b1d1798.tar.bz2 depot-48c8a4145c5a73874797a6de3f05ce584b1d1798.zip | |
Diffstat (limited to 'default.nix')
| -rw-r--r-- | default.nix | 51 |
1 files changed, 45 insertions, 6 deletions
diff --git a/default.nix b/default.nix index fbf95e4..235d4e5 100644 --- a/default.nix +++ b/default.nix @@ -1,11 +1,14 @@ let lock = builtins.readFile ./flake.lock |> builtins.fromJSON; - defaultNixpkgs = builtins.fetchGit { - url = "https://github.com/NixOS/nixpkgs"; - shallow = true; - inherit (lock.nodes.nixpkgs.locked) rev; - inherit (lock.nodes.nixpkgs.original) ref; + defaultNixpkgs = builtins.fetchTarball { + inherit (lock.nodes.nixpkgs.locked) url; + sha256 = lock.nodes.nixpkgs.locked.narHash; + }; + + disko = builtins.fetchTarball { + url = "https://github.com/nix-community/disko/archibe/${lock.nodes.disko.locked.rev}tar.gz"; + sha256 = lock.nodes.disko.locked.narHash; }; in { @@ -22,6 +25,8 @@ let packagesFromDirectoryRecursive ; + importDir = import lib/importDir.nix { inherit lib; }; + overlay = final: _: let @@ -32,6 +37,7 @@ let in { inherit depotPackages; + depot = depotPackages; }; newPkgs = import defaultNixpkgs { @@ -43,5 +49,38 @@ let overlays = [ overlay ]; }; + nixosModules = importDir ./modules (builtins.mapAttrs (_: { path, ... }: path)); + + machines = importDir ./machines ( + entries: + let + defaultModule = { config, ... }: { + nixpkgs.overlays = [ overlay ]; + system.stateVersion = lib.mkDefault config.system.nixos.release; + }; + + buildNixOS = + hostName: entry: + import (pkgs.path + "/nixos/lib/eval-config.nix") { + modules = [ + defaultModule + entry.path + nixosModules.xnet + nixosModules.disk + nixosModules.desktop + nixosModules.network + nixosModules.sshd + nixosModules.users + ("${disko}/module.nix") + ]; + }; + in + builtins.mapAttrs buildNixOS entries + ); + in -newPkgs.depotPackages +{ + pkgs = newPkgs; + inherit (newPkgs) depotPackages; + inherit machines; +} |
