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

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
];
};
};
}