From 31cdee898a5a4757191e9be048fe67bdbd89a151 Mon Sep 17 00:00:00 2001 From: Michael Mandl Date: Fri, 17 Jun 2022 17:00:08 +0200 Subject: [PATCH] feat: impure flake setup --- configuration.nix | 8 +------- flake.lock | 49 +++++++++++++++++++++++++++++++++++++++++++++++ flake.nix | 22 +++++++++++++++++++++ 3 files changed, 72 insertions(+), 7 deletions(-) create mode 100644 flake.lock create mode 100644 flake.nix diff --git a/configuration.nix b/configuration.nix index d6ac582..890909a 100644 --- a/configuration.nix +++ b/configuration.nix @@ -2,8 +2,7 @@ # your system. Help is available in the configuration.nix(5) man page # and in the NixOS manual (accessible by running ‘nixos-help’). -{ config, pkgs, ... }: - +{ config, lib, pkgs, inputs, ... }: { imports = [ # Include the results of the hardware scan. @@ -105,10 +104,5 @@ # Before changing this value read the documentation for this option # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). system.stateVersion = "22.05"; # Did you read the comment? - - nix = { - package = pkgs.nixFlakes; - extraOptions = "experimental-features = nix-command flakes"; - }; } diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..b3e026b --- /dev/null +++ b/flake.lock @@ -0,0 +1,49 @@ +{ + "nodes": { + "home-manager": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1654113405, + "narHash": "sha256-VpK+0QaWG2JRgB00lw77N9TjkE3ec0iMYIX1TzGpxa4=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "ac2287df5a2d6f0a44bbcbd11701dbbf6ec43675", + "type": "github" + }, + "original": { + "owner": "nix-community", + "ref": "release-22.05", + "repo": "home-manager", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1655470064, + "narHash": "sha256-sELkMX4YGAoH78ci1mCBpW0ZSjqEMVzs9kSQz4gRAJs=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "f919a40e544da31a3b4b42e87cf30a5078c2b09c", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "release-22.05", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "home-manager": "home-manager", + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..701c76d --- /dev/null +++ b/flake.nix @@ -0,0 +1,22 @@ +{ + inputs = { + nixpkgs.url = github:NixOS/nixpkgs/release-22.05; + + home-manager = { + url = github:nix-community/home-manager/release-22.05; + inputs.nixpkgs.follows = "nixpkgs"; + }; + }; + + outputs = inputs @ { self, nixpkgs, home-manager, ... }: + let + user = "mandlm"; + in + { + nixosConfigurations.nixos-vm = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + specialArgs = inputs; + modules = [ ./configuration.nix ]; + }; + }; +}