Updating flake

This commit is contained in:
rasmus-kirk
2024-10-25 15:03:55 +02:00
parent a3fad60dd2
commit 59c5bc66e4
2 changed files with 32 additions and 136 deletions
Generated
+3 -80
View File
@@ -1,25 +1,5 @@
{ {
"nodes": { "nodes": {
"devshell": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1722113426,
"narHash": "sha256-Yo/3loq572A8Su6aY5GP56knpuKYRvM2a1meP9oJZCw=",
"owner": "numtide",
"repo": "devshell",
"rev": "67cce7359e4cd3c45296fb4aaf6a19e2a9c757ae",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "devshell",
"type": "github"
}
},
"flake-parts": { "flake-parts": {
"inputs": { "inputs": {
"nixpkgs-lib": [ "nixpkgs-lib": [
@@ -40,42 +20,6 @@
"type": "github" "type": "github"
} }
}, },
"flake-parts_2": {
"inputs": {
"nixpkgs-lib": [
"vpnconfinement",
"nixpkgs"
]
},
"locked": {
"lastModified": 1717285511,
"narHash": "sha256-iKzJcpdXih14qYVcZ9QC9XuZYnPc6T8YImb6dX166kw=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "2a55567fcf15b1b1c7ed712a2c6fadaec7412ea8",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "flake-parts",
"type": "github"
}
},
"flake-root": {
"locked": {
"lastModified": 1723604017,
"narHash": "sha256-rBtQ8gg+Dn4Sx/s+pvjdq3CB2wQNzx9XGFq/JVGCB6k=",
"owner": "srid",
"repo": "flake-root",
"rev": "b759a56851e10cb13f6b8e5698af7b59c44be26e",
"type": "github"
},
"original": {
"owner": "srid",
"repo": "flake-root",
"type": "github"
}
},
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1726583932, "lastModified": 1726583932,
@@ -94,12 +38,9 @@
}, },
"root": { "root": {
"inputs": { "inputs": {
"devshell": "devshell",
"flake-parts": "flake-parts", "flake-parts": "flake-parts",
"flake-root": "flake-root",
"nixpkgs": "nixpkgs", "nixpkgs": "nixpkgs",
"submerger": "submerger", "submerger": "submerger",
"treefmt-nix": "treefmt-nix",
"vpnconfinement": "vpnconfinement" "vpnconfinement": "vpnconfinement"
} }
}, },
@@ -145,29 +86,11 @@
"type": "github" "type": "github"
} }
}, },
"treefmt-nix": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1726734507,
"narHash": "sha256-VUH5O5AcOSxb0uL/m34dDkxFKP6WLQ6y4I1B4+N3L2w=",
"owner": "numtide",
"repo": "treefmt-nix",
"rev": "ee41a466c2255a3abe6bc50fc6be927cdee57a9f",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "treefmt-nix",
"type": "github"
}
},
"vpnconfinement": { "vpnconfinement": {
"inputs": { "inputs": {
"flake-parts": "flake-parts_2", "flake-parts": [
"flake-parts"
],
"nixpkgs": [ "nixpkgs": [
"nixpkgs" "nixpkgs"
] ]
+25 -52
View File
@@ -14,78 +14,51 @@
submerger.url = "github:rasmus-kirk/submerger"; submerger.url = "github:rasmus-kirk/submerger";
submerger.inputs.nixpkgs.follows = "nixpkgs"; submerger.inputs.nixpkgs.follows = "nixpkgs";
# Flake stuff
flake-parts.url = "github:hercules-ci/flake-parts";
flake-parts.inputs.nixpkgs-lib.follows = "nixpkgs";
flake-root.url = "github:srid/flake-root";
devshell.url = "github:numtide/devshell";
devshell.inputs.nixpkgs.follows = "nixpkgs";
treefmt-nix.url = "github:numtide/treefmt-nix";
treefmt-nix.inputs.nixpkgs.follows = "nixpkgs";
}; };
outputs = { outputs = {
flake-parts, nixpkgs,
vpnconfinement, vpnconfinement,
submerger, submerger,
... ...
} @ inputs: } @ inputs:
flake-parts.lib.mkFlake { let
inherit inputs; # Systems supported
} { supportedSystems = [
imports = with inputs; [ "x86_64-linux" # 64-bit Intel/AMD Linux
flake-root.flakeModule "aarch64-linux" # 64-bit ARM Linux
treefmt-nix.flakeModule "x86_64-darwin" # 64-bit Intel macOS
devshell.flakeModule "aarch64-darwin" # 64-bit ARM macOS
];
systems = [
"x86_64-linux"
]; ];
flake = { # Helper to provide system-specific attributes
forAllSystems = f: nixpkgs.lib.genAttrs supportedSystems (system: f {
pkgs = import nixpkgs { inherit system; };
});
in {
nixosModules = rec { nixosModules = rec {
nixarr = import ./nixarr submerger vpnconfinement; nixarr = import ./nixarr submerger vpnconfinement;
imports = [ vpnconfinement.nixosModules.default ]; imports = [ vpnconfinement.nixosModules.default ];
default = nixarr; default = nixarr;
}; };
};
perSystem = { devShells = forAllSystems ({ pkgs } : {
config, default = pkgs.mkShell {
pkgs, packages = with pkgs; [
... alejandra
}: { ];
treefmt.config = {
inherit (config.flake-root) projectRootFile;
package = pkgs.treefmt;
programs = {
alejandra.enable = true;
deadnix.enable = true;
};
}; };
});
packages = rec { packages = forAllSystems ({ pkgs } : {
default = pkgs.mkShell rec {
docs = pkgs.callPackage ./mkDocs.nix {inherit inputs;}; docs = pkgs.callPackage ./mkDocs.nix {inherit inputs;};
default = docs; default = docs;
}; };
});
devshells.default = { formatters = forAllSystems ({ pkgs } : {
name = "Rasmus Kirk"; default = pkgs.alejandra;
});
commands = [
{
category = "Tools";
name = "fmt";
help = "Format the source tree";
command = "nix fmt";
}
];
};
};
}; };
} }