From bd3396bfa9e0c2640e61d75757edbebf9ad54575 Mon Sep 17 00:00:00 2001 From: coolneng Date: Sun, 8 Aug 2021 19:56:16 +0100 Subject: [PATCH] Migrate to flakes --- configuration.nix | 4 +++- flake.nix | 29 +++++++++++++++++++++++++++++ 2 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 flake.nix diff --git a/configuration.nix b/configuration.nix index d667658..392882f 100644 --- a/configuration.nix +++ b/configuration.nix @@ -36,7 +36,7 @@ timeout = 3; }; - # Run Nix garbage collector, while avoiding compiling + # Run Nix garbage collector and enable flakes nix = { autoOptimiseStore = true; gc = { @@ -48,7 +48,9 @@ keep-outputs = true keep-derivations = true gc-keep-outputs = true + experimental-features = nix-command flakes ''; + package = pkgs.nixUnstable; }; # Clean tmp directory on shutdown diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..fbdae10 --- /dev/null +++ b/flake.nix @@ -0,0 +1,29 @@ +{ + description = "System configuration for panacea"; + + inputs = { + nixpkgs.url = "nixpkgs/nixos-unstable"; + agenix.url = "github:ryantm/agenix"; + agenix.inputs.nixpkgs.follows = "nixpkgs"; + emacs-overlay.url = "github:nix-community/emacs-overlay"; + rnix-lsp.url = "github:nix-community/rnix-lsp"; + }; + + outputs = inputs@{ self, nixpkgs, agenix, ... }: + let + system = "x86_64-linux"; + + pkgs = import pkgs { + inherit system; + config.allowUnfree = true; + }; + + lib = nixpkgs.lib; + + in { + nixosConfigurations.panacea = lib.nixosSystem { + inherit system; + modules = [ (import ./configuration.nix) agenix.nixosModules.age ]; + }; + }; +}