diff --git a/desktop/flake.nix b/desktop/flake.nix index 720263a..96afc63 100644 --- a/desktop/flake.nix +++ b/desktop/flake.nix @@ -10,13 +10,11 @@ nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.05"; }; - outputs = { self, nixpkgs, home-manager, bootstrap, ... }: + outputs = { nixpkgs, home-manager, bootstrap, ... }: let system = "x86_64-linux"; in { - # Used with `nixos-rebuild --flake .#` - # nixosConfigurations."".config.system.build.toplevel must be a derivation nixosConfigurations.nixos = nixpkgs.lib.nixosSystem { inherit system; # Modules can be attribute sets or a function that returns an attribute set. diff --git a/digital-ocean/flake.nix b/digital-ocean/flake.nix index 44deab8..c6d124f 100644 --- a/digital-ocean/flake.nix +++ b/digital-ocean/flake.nix @@ -15,8 +15,7 @@ ]; system.stateVersion = "23.11"; }; - in - { + in { packages.${system}.default = (pkgs.nixos module).digitalOceanImage; }; } diff --git a/hive/flake.lock b/hive/flake.lock index b416269..1b65440 100644 --- a/hive/flake.lock +++ b/hive/flake.lock @@ -2,11 +2,11 @@ "nodes": { "nixpkgs": { "locked": { - "lastModified": 1701802827, - "narHash": "sha256-wTn0lpV75Uv6tU6haEypNsmnJJPb0hpaMIy/4uf5AiQ=", + "lastModified": 1701952659, + "narHash": "sha256-TJv2srXt6fYPUjxgLAL0cy4nuf1OZD4KuA1TrCiQqg0=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "a804fc878d7ba1558b960b4c64b0903da426ac41", + "rev": "b4372c4924d9182034066c823df76d6eaf1f4ec4", "type": "github" }, "original": { @@ -16,9 +16,27 @@ "type": "github" } }, + "phobos": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1, + "narHash": "sha256-D7vDC0Qph0MikxxgIlCNduD1o7QfQQO5SRtGLAVwywg=", + "path": "./phobos", + "type": "path" + }, + "original": { + "path": "./phobos", + "type": "path" + } + }, "root": { "inputs": { - "nixpkgs": "nixpkgs" + "nixpkgs": "nixpkgs", + "phobos": "phobos" } } }, diff --git a/hive/flake.nix b/hive/flake.nix index 35b30b5..6eb7fd2 100644 --- a/hive/flake.nix +++ b/hive/flake.nix @@ -2,20 +2,23 @@ description = "Configuration of all remote NixOS machines."; inputs = { + phobos = { + url = "path:./phobos"; + inputs.nixpkgs.follows = "nixpkgs"; + }; nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.11"; }; - outputs = { nixpkgs, ... }: - { - colmena = { - meta = { - nixpkgs = import nixpkgs { - system = "x86_64-linux"; - }; + outputs = { nixpkgs, phobos, ... }: { + colmena = { + meta = { + nixpkgs = import nixpkgs { + system = "x86_64-linux"; }; - - # Remote machines - phobos = (import ./phobos.nix); }; + + # Remote machines + phobos = phobos.nixosModules.default; }; + }; } diff --git a/hive/phobos.nix b/hive/phobos.nix deleted file mode 100644 index 0b4475c..0000000 --- a/hive/phobos.nix +++ /dev/null @@ -1,12 +0,0 @@ -{ modulesPath, lib, ... }: -{ - imports = lib.optional (builtins.pathExists ./do-userdata.nix) ./do-userdata.nix ++ [ - (modulesPath + "/virtualisation/digital-ocean-config.nix") - ]; - - deployment.targetHost = "146.190.127.180"; - - networking.hostName = "phobos"; - - system.stateVersion = "23.11"; -} diff --git a/hive/phobos/flake.lock b/hive/phobos/flake.lock new file mode 100644 index 0000000..a9a33a9 --- /dev/null +++ b/hive/phobos/flake.lock @@ -0,0 +1,27 @@ +{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1701615100, + "narHash": "sha256-7VI84NGBvlCTduw2aHLVB62NvCiZUlALLqBe5v684Aw=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "e9f06adb793d1cca5384907b3b8a4071d5d7cb19", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-23.05", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/hive/phobos/flake.nix b/hive/phobos/flake.nix new file mode 100644 index 0000000..7318e9a --- /dev/null +++ b/hive/phobos/flake.nix @@ -0,0 +1,21 @@ +{ + description = "Phobos machine"; + + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.05"; + }; + + outputs = { nixpkgs, ... }: { + nixosModules.default = { modulesPath, lib, ... }: { + imports = lib.optional (builtins.pathExists ./do-userdata.nix) ./do-userdata.nix ++ [ + (modulesPath + "/virtualisation/digital-ocean-config.nix") + ]; + + deployment.targetHost = "146.190.127.180"; + + networking.hostName = "phobos"; + + system.stateVersion = "23.11"; + }; + }; +}