diff --git a/.envrc b/.envrc index 1d953f4..3550a30 100644 --- a/.envrc +++ b/.envrc @@ -1 +1 @@ -use nix +use flake diff --git a/flake.lock b/flake.lock index d10cb28..9ac472b 100644 --- a/flake.lock +++ b/flake.lock @@ -3,7 +3,9 @@ "agenix": { "inputs": { "agenix": "agenix_2", - "flake-utils": "flake-utils", + "flake-utils": [ + "flake-utils" + ], "nixpkgs": [ "nixpkgs" ], @@ -218,11 +220,11 @@ }, "flake-utils": { "locked": { - "lastModified": 1676283394, - "narHash": "sha256-XX2f9c3iySLCw54rJ/CZs+ZK6IQy7GXNY4nSOyu2QG4=", + "lastModified": 1678901627, + "narHash": "sha256-U02riOqrKKzwjsxc/400XnElV+UtPUQWpANPlyazjH0=", "owner": "numtide", "repo": "flake-utils", - "rev": "3db36a8b464d0c4532ba1c7dda728f4576d6d073", + "rev": "93a2b84fc4b70d9e089d029deacc3583435c2ed6", "type": "github" }, "original": { @@ -302,11 +304,11 @@ "utils": "utils" }, "locked": { - "lastModified": 1678729503, - "narHash": "sha256-j+h4Bdqbe+qjzhxdhkRmVgSx2lxJ8HnKeYcAhhnd1zM=", + "lastModified": 1679067095, + "narHash": "sha256-G2dJQURL/CCi+8RP6jNJG8VqgtzEMCA+6mNodd3VR6E=", "owner": "nix-community", "repo": "home-manager", - "rev": "24c1a6335e3da6a3ecf82f33ac50c2ad66aee346", + "rev": "3239e0b40f242f47bf6c0c37b2fd35ab3e76e370", "type": "github" }, "original": { @@ -348,11 +350,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1678654296, - "narHash": "sha256-aVfw3ThpY7vkUeF1rFy10NAkpKDS2imj3IakrzT0Occ=", + "lastModified": 1679081381, + "narHash": "sha256-n4+SbrVohxbgbmOTkodfxc3d8W38OfKowD6YNA8j27o=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "5a1dc8acd977ff3dccd1328b7c4a6995429a656b", + "rev": "b573a7f69484a7d213680abb70b4f95bdc28eee5", "type": "github" }, "original": { @@ -380,22 +382,6 @@ "type": "github" } }, - "nixpkgs_2": { - "locked": { - "lastModified": 1670507980, - "narHash": "sha256-riNZa0xzM1it3pzxciwALeMs+0CsBMWIW2FqulzK8vM=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "2787fc7d1e51404678614bf0fe92fc296746eec0", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixos-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, "poetry2nix": { "flake": false, "locked": { @@ -443,6 +429,7 @@ "root": { "inputs": { "agenix": "agenix", + "flake-utils": "flake-utils", "home-manager": "home-manager", "nixpkgs": "nixpkgs", "webcord": "webcord" @@ -508,7 +495,9 @@ "webcord": { "inputs": { "dream2nix": "dream2nix", - "nixpkgs": "nixpkgs_2", + "nixpkgs": [ + "nixpkgs" + ], "webcord": "webcord_2" }, "locked": { diff --git a/flake.nix b/flake.nix index 4d124e2..31f206d 100644 --- a/flake.nix +++ b/flake.nix @@ -3,10 +3,12 @@ inputs = { nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + flake-utils.url = "github:numtide/flake-utils"; agenix = { url = "github:yaxitech/ragenix"; inputs.nixpkgs.follows = "nixpkgs"; + inputs.flake-utils.follows = "flake-utils"; }; home-manager = { @@ -14,50 +16,62 @@ inputs.nixpkgs.follows = "nixpkgs"; }; - webcord.url = "github:fufexan/webcord-flake"; - }; - - outputs = { nixpkgs, agenix, home-manager, webcord, ... }@inputs: { - # colmena - colmena = { - meta = { - nixpkgs = import nixpkgs { - system = "x86_64-linux"; - overlays = [ ]; - }; - }; - - # default config - defaults = { name, ... }: { - imports = [ - ./hosts/${name}/configuration.nix - home-manager.nixosModules.home-manager - agenix.nixosModules.default - ]; - home-manager = { - useGlobalPkgs = true; - useUserPackages = true; - }; - }; - - # personnal laptop - neodymium = { ... }: { - home-manager.users.laurent = { - imports = [ webcord.homeManagerModules.default ]; - }; - deployment = { - allowLocalDeployment = true; - targetHost = null; - }; - }; - - # ovh vps - hydrogen = { ... }: { - deployment = { - targetHost = "178.62.253.235"; - targetUser = "root"; - }; - }; + webcord = { + url = "github:fufexan/webcord-flake"; + inputs.nixpkgs.follows = "nixpkgs"; }; }; + + outputs = { nixpkgs, flake-utils, agenix, home-manager, webcord, ... }@inputs: + + # Provide colmena + (flake-utils.lib.eachDefaultSystem (system: + let pkgs = nixpkgs.legacyPackages.${system}; + in { + devShells.default = pkgs.mkShell { packages = [ pkgs.colmena ]; }; + })) // { + + # colmena + colmena = { + meta = { + nixpkgs = import nixpkgs { + system = "x86_64-linux"; + overlays = [ ]; + }; + }; + + # default config + defaults = { name, ... }: { + imports = [ + ./hosts/${name}/configuration.nix + home-manager.nixosModules.home-manager + agenix.nixosModules.default + ]; + home-manager = { + useGlobalPkgs = true; + useUserPackages = true; + }; + }; + + # personnal laptop + neodymium = { ... }: { + home-manager.users.laurent = { + imports = [ webcord.homeManagerModules.default ]; + }; + deployment = { + allowLocalDeployment = true; + targetHost = null; + }; + }; + + # ovh vps + hydrogen = { ... }: { + deployment = { + targetHost = "178.62.253.235"; + targetUser = "root"; + }; + }; + }; + }; + } diff --git a/shell.nix b/shell.nix deleted file mode 100644 index 43b7fce..0000000 --- a/shell.nix +++ /dev/null @@ -1,3 +0,0 @@ -{ pkgs ? import { } }: - -pkgs.mkShell { buildInputs = with pkgs; [ colmena nixfmt ]; }