nix: add flake to build home
This commit is contained in:
parent
b1762e8404
commit
dc1bfc8d83
4 changed files with 86 additions and 10 deletions
37
flake.lock
37
flake.lock
|
@ -1,5 +1,26 @@
|
|||
{
|
||||
"nodes": {
|
||||
"home-manager": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
"nixpkgs"
|
||||
],
|
||||
"utils": "utils"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1661573386,
|
||||
"narHash": "sha256-pBEg8iY00Af/SAtU2dlmOAv+2x7kScaGlFRDjNoVJO8=",
|
||||
"owner": "nix-community",
|
||||
"repo": "home-manager",
|
||||
"rev": "d89bdff445eadff03fe414e9c30486bc8166b72b",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nix-community",
|
||||
"repo": "home-manager",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1661628722,
|
||||
|
@ -18,8 +39,24 @@
|
|||
},
|
||||
"root": {
|
||||
"inputs": {
|
||||
"home-manager": "home-manager",
|
||||
"nixpkgs": "nixpkgs"
|
||||
}
|
||||
},
|
||||
"utils": {
|
||||
"locked": {
|
||||
"lastModified": 1653893745,
|
||||
"narHash": "sha256-0jntwV3Z8//YwuOjzhV2sgJJPt+HY6KhU7VZUL0fKZQ=",
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"rev": "1ed9fb1935d260de5fe1c2f7ee0ebaae17ed2fa1",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"type": "github"
|
||||
}
|
||||
}
|
||||
},
|
||||
"root": "root",
|
||||
|
|
32
flake.nix
32
flake.nix
|
@ -1,16 +1,28 @@
|
|||
{
|
||||
inputs = {
|
||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||
};
|
||||
nixpkgs.url = github:NixOS/nixpkgs/nixos-unstable;
|
||||
|
||||
|
||||
outputs = { self, nixpkgs }: {
|
||||
nixosConfigurations.systemHome = nixpkgs.lib.nixosSystem {
|
||||
system = "x86_64-linux";
|
||||
modules = [
|
||||
./system/configuration.nix
|
||||
./system/machine/home
|
||||
];
|
||||
home-manager = {
|
||||
url = github:nix-community/home-manager;
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
};
|
||||
|
||||
outputs = inputs @ { self, nixpkgs, ... }:
|
||||
let
|
||||
system = "x86_64-linux";
|
||||
in
|
||||
{
|
||||
homeConfigurations = import ./outputs/home.nix {
|
||||
inherit inputs system;
|
||||
};
|
||||
|
||||
nixosConfigurations = import ./outputs/system.nix {
|
||||
inherit nixpkgs system;
|
||||
};
|
||||
|
||||
devShell.${system} = import ./shell.nix {
|
||||
pkgs = import nixpkgs { inherit system; };
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
16
outputs/home.nix
Normal file
16
outputs/home.nix
Normal file
|
@ -0,0 +1,16 @@
|
|||
{ inputs, system }:
|
||||
|
||||
with inputs;
|
||||
|
||||
let
|
||||
pkgs = import nixpkgs { inherit system; };
|
||||
in
|
||||
{
|
||||
homeMe = home-manager.lib.homeManagerConfiguration {
|
||||
inherit pkgs;
|
||||
|
||||
modules = [
|
||||
../home/home.nix
|
||||
];
|
||||
};
|
||||
}
|
11
outputs/system.nix
Normal file
11
outputs/system.nix
Normal file
|
@ -0,0 +1,11 @@
|
|||
{ nixpkgs, system }:
|
||||
|
||||
{
|
||||
systemHome = nixpkgs.lib.nixosSystem {
|
||||
inherit system;
|
||||
modules = [
|
||||
../system/configuration.nix
|
||||
../system/machine/home
|
||||
];
|
||||
};
|
||||
}
|
Loading…
Reference in a new issue