From 747d2bd03fb672d87b849dd998dcf8e0a2bc2721 Mon Sep 17 00:00:00 2001 From: Pim Kunis Date: Sun, 8 Oct 2023 18:03:14 +0200 Subject: [PATCH] add home manager as a flake --- .gitignore | 1 - configuration.nix | 2 +- flake.lock | 17 +++++++++++++++++ flake.nix | 16 +++++++++++++--- 4 files changed, 31 insertions(+), 5 deletions(-) delete mode 100644 .gitignore diff --git a/.gitignore b/.gitignore deleted file mode 100644 index b2be92b..0000000 --- a/.gitignore +++ /dev/null @@ -1 +0,0 @@ -result diff --git a/configuration.nix b/configuration.nix index 25b054d..1ade130 100644 --- a/configuration.nix +++ b/configuration.nix @@ -29,7 +29,7 @@ in excludePackages = with pkgs; [ xterm ]; }; - home-manager.users.pim = import ./home/home.nix; + # home-manager.users.pim = import ./home/home.nix; users.users.pim = { isNormalUser = true; diff --git a/flake.lock b/flake.lock index ca441ac..9b10abe 100644 --- a/flake.lock +++ b/flake.lock @@ -1,5 +1,21 @@ { "nodes": { + "home-manager": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "narHash": "sha256-gSg7UTVtls2yO9lKtP0yb66XBHT1Fx5qZSZbGMpSn2c=", + "type": "tarball", + "url": "https://github.com/nix-community/home-manager/archive/release-23.05.tar.gz" + }, + "original": { + "type": "tarball", + "url": "https://github.com/nix-community/home-manager/archive/release-23.05.tar.gz" + } + }, "nixpkgs": { "locked": { "lastModified": 1696697597, @@ -18,6 +34,7 @@ }, "root": { "inputs": { + "home-manager": "home-manager", "nixpkgs": "nixpkgs" } } diff --git a/flake.nix b/flake.nix index 3f8df6d..41ff6dd 100644 --- a/flake.nix +++ b/flake.nix @@ -3,9 +3,13 @@ inputs = { nixpkgs.url = "github:nixos/nixpkgs/nixos-23.05"; + home-manager = { + url = "https://github.com/nix-community/home-manager/archive/release-23.05.tar.gz"; + inputs.nixpkgs.follows = "nixpkgs"; + }; }; - outputs = { self, nixpkgs }: + outputs = { self, nixpkgs, home-manager }: let system = "x86_64-linux"; pkgs = import nixpkgs { @@ -18,10 +22,16 @@ { nixosConfigurations = { myNixos = nixpkgs.lib.nixosSystem { - specialArgs = { inherit system; }; - + inherit system; modules = [ ./configuration.nix + home-manager.nixosModules.home-manager { + home-manager.useGlobalPkgs = true; + home-manager.useUserPackages = true; + home-manager.users.pim = { + imports = [ ./home/home.nix ]; + }; + } ]; }; };