diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..ee8f4a8 --- /dev/null +++ b/flake.lock @@ -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 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..568d62e --- /dev/null +++ b/flake.nix @@ -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 + ]; + }; + }; +}