diff --git a/Makefile b/Makefile new file mode 100644 index 00000000..7e9c2509 --- /dev/null +++ b/Makefile @@ -0,0 +1,6 @@ +.PHONY: update clean +update: + home-manager switch --flake .#functionalhacker + +clean: + nix-collect-garbage -d diff --git a/common.nix b/common.nix index f5c64b1c..15b8ff2a 100644 --- a/common.nix +++ b/common.nix @@ -64,14 +64,12 @@ }; environment.systemPackages = with pkgs; [ + git + gnumake + home-manager neovim telegram-desktop - zsh - neofetch usbutils wl-clipboard - git - pass - gnumake ]; } diff --git a/flake.lock b/flake.lock index 7f382f67..e0f510c2 100644 --- a/flake.lock +++ b/flake.lock @@ -1,5 +1,26 @@ { "nodes": { + "home-manager": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1725703823, + "narHash": "sha256-tDgM4d8mLK0Hd6YMB2w1BqMto1XBXADOzPEaLl10VI4=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "208df2e558b73b6a1f0faec98493cb59a25f62ba", + "type": "github" + }, + "original": { + "owner": "nix-community", + "ref": "release-24.05", + "repo": "home-manager", + "type": "github" + } + }, "nixpkgs": { "locked": { "lastModified": 1726320982, @@ -18,6 +39,7 @@ }, "root": { "inputs": { + "home-manager": "home-manager", "nixpkgs": "nixpkgs" } } diff --git a/flake.nix b/flake.nix index 463ba7c2..19b0b102 100644 --- a/flake.nix +++ b/flake.nix @@ -3,15 +3,32 @@ inputs = { nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.05"; - }; - outputs = { self, nixpkgs, ...}@inputs: { - nixosConfigurations.Mirkwood = nixpkgs.lib.nixosSystem { - system = "x86_64-linux"; - modules = [ - ./common.nix - ./hosts/Mirkwood/configuration.nix - ]; + home-manager = { + url = "github:nix-community/home-manager/release-24.05"; + inputs.nixpkgs.follows = "nixpkgs"; }; }; + + outputs = { nixpkgs, home-manager, ...}: + let + lib = nixpkgs.lib; + system = "x86_64-linux"; + pkgs = import nixpkgs { inherit system; }; + in { + nixosConfigurations.Mirkwood = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + modules = [ + ./common.nix + ./hosts/Mirkwood/configuration.nix + ]; + }; + + homeConfigurations = { + functionalhacker = home-manager.lib.homeManagerConfiguration { + inherit pkgs; + modules = [ ./home.nix ]; + }; + }; + }; } diff --git a/home.nix b/home.nix new file mode 100644 index 00000000..9a3b88d8 --- /dev/null +++ b/home.nix @@ -0,0 +1,15 @@ +{ lib, pkgs, ... }: + +{ + home = { + packages = with pkgs; [ + neofetch + pass + zsh + ]; + + username = "functionalhacker"; + homeDirectory = "/home/functionalhacker"; + stateVersion = "24.05"; + }; +}