flake: add system agnostic devShell w/ flake-utils
This commit is contained in:
parent
782c03d600
commit
d03b58b414
16
flake.lock
16
flake.lock
|
@ -1,5 +1,20 @@
|
|||
{
|
||||
"nodes": {
|
||||
"futils": {
|
||||
"locked": {
|
||||
"lastModified": 1614513358,
|
||||
"narHash": "sha256-LakhOx3S1dRjnh0b5Dg3mbZyH0ToC9I8Y2wKSkBaTzU=",
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"rev": "5466c5bbece17adaab2d82fae80b46e807611bf3",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"home-manager": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
|
@ -53,6 +68,7 @@
|
|||
},
|
||||
"root": {
|
||||
"inputs": {
|
||||
"futils": "futils",
|
||||
"home-manager": "home-manager",
|
||||
"nixpkgs": "nixpkgs",
|
||||
"nur": "nur"
|
||||
|
|
17
flake.nix
17
flake.nix
|
@ -5,11 +5,13 @@
|
|||
home-manager.inputs.nixpkgs.follows = "nixpkgs";
|
||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||
nur.url = "github:nix-community/NUR";
|
||||
futils.url = "github:numtide/flake-utils";
|
||||
};
|
||||
|
||||
outputs = { self, nixpkgs, nur, home-manager }:
|
||||
outputs = { self, nixpkgs, nur, home-manager, futils }:
|
||||
let
|
||||
inherit (nixpkgs) lib;
|
||||
inherit (futils.lib) eachDefaultSystem;
|
||||
|
||||
defaultModules = [
|
||||
({ pkgs, ... }: {
|
||||
|
@ -36,7 +38,20 @@
|
|||
];
|
||||
};
|
||||
in
|
||||
eachDefaultSystem
|
||||
(system:
|
||||
let
|
||||
pkgs = nixpkgs.legacyPackages.${system};
|
||||
in
|
||||
{
|
||||
devShell = pkgs.mkShell {
|
||||
name = "NixOS-config";
|
||||
buildInputs = with pkgs; [
|
||||
gitAndTools.pre-commit
|
||||
nixpkgs-fmt
|
||||
];
|
||||
};
|
||||
}) // {
|
||||
nixosConfigurations = nixpkgs.lib.mapAttrs buildHost {
|
||||
porthos = "x86_64-linux";
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue