Switched to using flake-utils

This reducies the number of things that I will need at sometime in the
theortical future, by doing more work now.
This commit is contained in:
James Patrick 2021-12-13 22:28:47 -05:00
parent f3dc384e73
commit 2c64ba8530
2 changed files with 89 additions and 26 deletions

View File

@ -1,5 +1,35 @@
{ {
"nodes": { "nodes": {
"emacs-overlay": {
"locked": {
"lastModified": 1639416884,
"narHash": "sha256-ucI8w/JcQQzEbppfPBK7HPfsy3HRi5hy2FoksuvkPCc=",
"owner": "nix-community",
"repo": "emacs-overlay",
"rev": "9516033899da467b8fcee6536a61ea66ebd0c4fa",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "emacs-overlay",
"type": "github"
}
},
"flake-utils": {
"locked": {
"lastModified": 1629481132,
"narHash": "sha256-JHgasjPR0/J1J3DRm4KxM4zTyAj4IOJY8vIl75v/kPI=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "997f7efcb746a9c140ce1f13c72263189225f482",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"home-manager": { "home-manager": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
@ -69,10 +99,31 @@
}, },
"root": { "root": {
"inputs": { "inputs": {
"emacs-overlay": "emacs-overlay",
"home-manager": "home-manager", "home-manager": "home-manager",
"nixos-hardware": "nixos-hardware", "nixos-hardware": "nixos-hardware",
"nixpkgs": "nixpkgs", "nixpkgs": "nixpkgs",
"nur": "nur" "nur": "nur",
"utils": "utils"
}
},
"utils": {
"inputs": {
"flake-utils": "flake-utils"
},
"locked": {
"lastModified": 1632420560,
"narHash": "sha256-8Tsa4Hp/CHCA6J8/E7EODhp75z5N1NBhFiOb3lBv/tI=",
"owner": "gytis-ivaskevicius",
"repo": "flake-utils-plus",
"rev": "4b1bcafcfcd78bd36ceabfe3872822ba5c7fcbe8",
"type": "github"
},
"original": {
"owner": "gytis-ivaskevicius",
"ref": "v1.3.0",
"repo": "flake-utils-plus",
"type": "github"
} }
} }
}, },

View File

@ -3,6 +3,7 @@
inputs = { inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
utils.url = "github:gytis-ivaskevicius/flake-utils-plus/v1.3.0";
home-manager = { home-manager = {
url = "github:nix-community/home-manager"; url = "github:nix-community/home-manager";
@ -18,22 +19,33 @@
url = "github:NixOS/nixos-hardware/master"; url = "github:NixOS/nixos-hardware/master";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
emacs-overlay = {
url = "github:nix-community/emacs-overlay";
inputs.nixpkgs.follows = "nixpkgs";
};
}; };
# All outputs for the system (configs) outputs = inputs@{ self, utils, nixpkgs, nixos-hardware, nur, home-manager
outputs = { home-manager, nixpkgs, nur, nixos-hardware, ... }: , emacs-overlay, ... }:
let utils.lib.mkFlake {
system = "x86_64-linux"; hosts = {
pkgs = import nixpkgs { nil.modules = [
inherit system; nixos-hardware.nixosModules.lenovo-thinkpad-t14-amd-gen1
config = { allowUnfree = true; }; ./hosts/nil.nix
];
}; };
lib = nixpkgs.lib;
in { # Shared logic below.
nixosConfigurations = { inherit self inputs;
# Config is based on hostname supportedSystems = [ "x86_64-linux" ];
nil = lib.nixosSystem { channels.nixpkgs = {
system = "x86_64-linux"; input = nixpkgs;
overlaysBuilder = channels: [ ];
};
channelsConfig = { allowUnfree = true; };
sharedOverlays = [ nur.overlay emacs-overlay.overlay ];
hostDefaults = {
modules = [ modules = [
nixos-hardware.nixosModules.lenovo-thinkpad-t14-amd-gen1 nixos-hardware.nixosModules.lenovo-thinkpad-t14-amd-gen1
./hosts/nil.nix ./hosts/nil.nix
@ -45,8 +57,8 @@
} }
{ nixpkgs.overlays = [ nur.overlay ]; } { nixpkgs.overlays = [ nur.overlay ]; }
]; ];
system = "x86_64-linux";
}; };
}; };
};
} }