flake: init configuration

This commit is contained in:
Bruno BELANYI 2021-02-05 16:25:39 +01:00
parent d79538e1ab
commit 34548c28ec
2 changed files with 51 additions and 0 deletions

27
flake.lock Normal file
View file

@ -0,0 +1,27 @@
{
"nodes": {
"nixpkgs": {
"locked": {
"lastModified": 1612433293,
"narHash": "sha256-p9vbZBJE8BqLr4uOC+RP12Kg6v6u/gpi8jJ2v1iBAk4=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "2b9daa020d40aac9d6ff3d1941d22acf4a3e9229",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-20.09",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"nixpkgs": "nixpkgs"
}
}
},
"root": "root",
"version": 7
}

24
flake.nix Normal file
View file

@ -0,0 +1,24 @@
{
description = "Nixos configuration with flakes";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-20.09";
};
outputs = { self, nixpkgs }: {
nixosConfigurations.porthos = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules =
[
({ pkgs, ... }: {
# Let 'nixos-version --json' know about the Git revision
# of this flake.
system.configurationRevision =
if self ? rev
then self.rev
else throw "Refusing to build from a dirty Git tree!";
})
./configuration.nix
];
};
};
}