nix: add flake to build home

This commit is contained in:
Dmitriy Pleshevskiy 2022-08-30 00:17:21 +03:00
parent b1762e8404
commit dc1bfc8d83
Signed by: pleshevskiy
GPG key ID: 1B59187B161C0215
4 changed files with 86 additions and 10 deletions

View file

@ -1,5 +1,26 @@
{ {
"nodes": { "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": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1661628722, "lastModified": 1661628722,
@ -18,8 +39,24 @@
}, },
"root": { "root": {
"inputs": { "inputs": {
"home-manager": "home-manager",
"nixpkgs": "nixpkgs" "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", "root": "root",

View file

@ -1,16 +1,28 @@
{ {
inputs = { inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; nixpkgs.url = github:NixOS/nixpkgs/nixos-unstable;
home-manager = {
url = github:nix-community/home-manager;
inputs.nixpkgs.follows = "nixpkgs";
};
}; };
outputs = inputs @ { self, nixpkgs, ... }:
outputs = { self, nixpkgs }: { let
nixosConfigurations.systemHome = nixpkgs.lib.nixosSystem {
system = "x86_64-linux"; system = "x86_64-linux";
modules = [ in
./system/configuration.nix {
./system/machine/home 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
View 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
View file

@ -0,0 +1,11 @@
{ nixpkgs, system }:
{
systemHome = nixpkgs.lib.nixosSystem {
inherit system;
modules = [
../system/configuration.nix
../system/machine/home
];
};
}