diff --git a/flake.lock b/flake.lock index 8c5148a..8bf7a78 100644 --- a/flake.lock +++ b/flake.lock @@ -34,6 +34,21 @@ } }, "flake-compat": { + "locked": { + "lastModified": 1733328505, + "narHash": "sha256-NeCCThCEP3eCl2l/+27kNNK7QrwZB1IJCrXfrbv5oqU=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "ff81ac966bb2cae68946d5ed5fc4994f96d0ffec", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, + "flake-compat_2": { "flake": false, "locked": { "lastModified": 1696426674, @@ -49,6 +64,24 @@ "type": "github" } }, + "flake-parts": { + "inputs": { + "nixpkgs-lib": "nixpkgs-lib" + }, + "locked": { + "lastModified": 1743550720, + "narHash": "sha256-hIshGgKZCgWh6AYJpJmRgFdR3WUbkY04o82X05xqQiY=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "c621e8422220273271f52058f618c94e405bb0f5", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, "gitignore": { "inputs": { "nixpkgs": [ @@ -71,23 +104,67 @@ "type": "github" } }, - "home-manager": { + "hjem": { "inputs": { "nixpkgs": [ "nixpkgs" ] }, "locked": { - "lastModified": 1745802917, - "narHash": "sha256-hI7BmIwKagCJlQdVgwxs1sLY2d8i97srcqT+OrhBDao=", - "owner": "nix-community", - "repo": "home-manager", - "rev": "9c46dc881c2afcb50ac9ae9f1c36b2a4ebba3c8a", + "lastModified": 1747038076, + "narHash": "sha256-vy+My+8yRRu0OG6XBEPDR8ebfrPS4iuruyQ1ZUyHq6s=", + "owner": "feel-co", + "repo": "hjem", + "rev": "7d674eaded6586554910e62baed5eadad6496315", "type": "github" }, "original": { - "owner": "nix-community", - "repo": "home-manager", + "owner": "feel-co", + "repo": "hjem", + "type": "github" + } + }, + "hjem-rum": { + "inputs": { + "hjem": "hjem_2", + "ndg": "ndg", + "nixpkgs": [ + "nixpkgs" + ], + "treefmt-nix": "treefmt-nix" + }, + "locked": { + "lastModified": 1747217237, + "narHash": "sha256-rYWxmjGpdGYlJd8gwripamC3t9mCihBDZJiz84CrUHI=", + "owner": "snugnug", + "repo": "hjem-rum", + "rev": "1d3bf26bb71dced495a99e05a0141db24c49ca6f", + "type": "github" + }, + "original": { + "owner": "snugnug", + "repo": "hjem-rum", + "type": "github" + } + }, + "hjem_2": { + "inputs": { + "nixpkgs": [ + "hjem-rum", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1746355589, + "narHash": "sha256-LguszqsDBTtdBxblQTtN7vOAYmfoe43aHkB8aK1dChE=", + "owner": "feel-co", + "repo": "hjem", + "rev": "77b37eeb583d43e1c723119a69c906235174ce57", + "type": "github" + }, + "original": { + "owner": "feel-co", + "repo": "hjem", "type": "github" } }, @@ -350,6 +427,30 @@ "type": "github" } }, + "ndg": { + "inputs": { + "flake-compat": "flake-compat", + "flake-parts": "flake-parts", + "nixpkgs": [ + "hjem-rum", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1746459301, + "narHash": "sha256-QcAaxXdcPMqY5IppLa9fHCq3Rzq597DQqq8s2fKuE0k=", + "owner": "feel-co", + "repo": "ndg", + "rev": "2864a9901102a86db82157f72998809c570c36bb", + "type": "github" + }, + "original": { + "owner": "feel-co", + "ref": "v2", + "repo": "ndg", + "type": "github" + } + }, "nixpkgs": { "locked": { "lastModified": 1745930157, @@ -366,6 +467,21 @@ "type": "github" } }, + "nixpkgs-lib": { + "locked": { + "lastModified": 1743296961, + "narHash": "sha256-b1EdN3cULCqtorQ4QeWgLMrd5ZGOjLSLemfa00heasc=", + "owner": "nix-community", + "repo": "nixpkgs.lib", + "rev": "e4822aea2a6d1cdd36653c134cacfd64c97ff4fa", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nixpkgs.lib", + "type": "github" + } + }, "nixpkgs_2": { "locked": { "lastModified": 1745930157, @@ -384,7 +500,7 @@ }, "pre-commit-hooks": { "inputs": { - "flake-compat": "flake-compat", + "flake-compat": "flake-compat_2", "gitignore": "gitignore", "nixpkgs": [ "hyprland", @@ -407,7 +523,8 @@ }, "root": { "inputs": { - "home-manager": "home-manager", + "hjem": "hjem", + "hjem-rum": "hjem-rum", "hyprland": "hyprland", "nixpkgs": "nixpkgs_2" } @@ -427,6 +544,27 @@ "type": "github" } }, + "treefmt-nix": { + "inputs": { + "nixpkgs": [ + "hjem-rum", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1746216483, + "narHash": "sha256-4h3s1L/kKqt3gMDcVfN8/4v2jqHrgLIe4qok4ApH5x4=", + "owner": "numtide", + "repo": "treefmt-nix", + "rev": "29ec5026372e0dec56f890e50dbe4f45930320fd", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "treefmt-nix", + "type": "github" + } + }, "xdph": { "inputs": { "hyprland-protocols": [ diff --git a/flake.nix b/flake.nix index 5132e49..13e7cf1 100644 --- a/flake.nix +++ b/flake.nix @@ -3,8 +3,13 @@ nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; hyprland.url = "github:hyprwm/Hyprland"; - home-manager = { - url = "github:nix-community/home-manager"; + hjem = { + url = "github:feel-co/hjem"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + + hjem-rum = { + url = "github:snugnug/hjem-rum"; inputs.nixpkgs.follows = "nixpkgs"; }; }; diff --git a/hosts/nixos-vm2/configuration.nix b/hosts/nixos-vm2/configuration.nix index a0745b9..07ddc09 100644 --- a/hosts/nixos-vm2/configuration.nix +++ b/hosts/nixos-vm2/configuration.nix @@ -1,10 +1,6 @@ { config, lib, pkgs, ... }: { - nix.settings = { - experimental-features = "nix-command flakes"; - }; - imports = [ ./hardware-configuration.nix @@ -15,17 +11,6 @@ boot.loader.grub.enable = true; boot.loader.grub.device = "/dev/vda"; - networking.hostName = "poslop-nixvm2"; - networking.networkmanager.enable = true; - - time.timeZone = "America/Chicago"; - - services.printing.enable = true; - - services.pipewire = { - enable = true; - pulse.enable = true; - }; services.spice-vdagentd.enable = true; diff --git a/modules/core/default.nix b/modules/core/default.nix index 52c3022..c8b7ce5 100644 --- a/modules/core/default.nix +++ b/modules/core/default.nix @@ -1,6 +1,11 @@ { imports = [ - #./packages.nix + ./hjem.nix + ./network.nix + ./packages.nix + ./timezone.nix + ./nix.nix + ./pipewire.nix ./program.nix ./user.nix ./ssh.nix diff --git a/modules/core/hjem.nix b/modules/core/hjem.nix new file mode 100644 index 0000000..2c19c9b --- /dev/null +++ b/modules/core/hjem.nix @@ -0,0 +1,20 @@ +{ + inputs, + username, + ... +}: + +{ + imports = [ inputs.hjem.nixosModules.default ]; + + config.hjem = { + extraModules = [inputs.hjem-rum.hjemModules.default]; + + users.${username} = { + enable = true; + directory = "/home/${username}"; + user = username; + }; + clobberByDefault = true; + }; +} diff --git a/modules/core/network.nix b/modules/core/network.nix new file mode 100644 index 0000000..d30c0dc --- /dev/null +++ b/modules/core/network.nix @@ -0,0 +1,4 @@ +{ + networking.hostName = "poslop-nixvm2"; + networking.networkmanager.enable = true; +} diff --git a/modules/core/nix.nix b/modules/core/nix.nix new file mode 100644 index 0000000..eb048f5 --- /dev/null +++ b/modules/core/nix.nix @@ -0,0 +1,5 @@ +{ + nix.settings = { + experimental-features = "nix-command flakes"; + }; +} diff --git a/modules/core/pipewire.nix b/modules/core/pipewire.nix new file mode 100644 index 0000000..7619ad7 --- /dev/null +++ b/modules/core/pipewire.nix @@ -0,0 +1,6 @@ +{ + services.pipewire = { + enable = true; + pulse.enable = true; + }; +} diff --git a/modules/core/timezone.nix b/modules/core/timezone.nix new file mode 100644 index 0000000..44c287f --- /dev/null +++ b/modules/core/timezone.nix @@ -0,0 +1,3 @@ +{ + time.timeZone = "America/Chicago"; +} diff --git a/modules/core/user.nix b/modules/core/user.nix index c29a086..b6c137c 100644 --- a/modules/core/user.nix +++ b/modules/core/user.nix @@ -1,25 +1,10 @@ { - pkgs, - inputs, username, - host, + pkgs, ... }: -{ - imports = [ inputs.home-manager.nixosModules.home-manager ]; - home-manager = { - useUserPackages = true; - useGlobalPkgs = true; - extraSpecialArgs = { inherit inputs username; }; - users.${username} = { - imports = [ ./../home ]; - home.username = "${username}"; - home.homeDirectory = "/home/${username}"; - home.stateVersion = "24.11"; - programs.home-manager.enable = true; - }; - }; +{ users.users.${username} = { isNormalUser = true; description = "${username}"; diff --git a/modules/home/default.nix b/modules/home/default.nix index 90c2fb3..e95598a 100644 --- a/modules/home/default.nix +++ b/modules/home/default.nix @@ -4,5 +4,6 @@ ./zsh ./git.nix ./packages.nix + ./neovim.nix ]; } diff --git a/modules/home/neovim.nix b/modules/home/neovim.nix new file mode 100644 index 0000000..dab3e42 --- /dev/null +++ b/modules/home/neovim.nix @@ -0,0 +1,8 @@ +{ pkgs, inputs, ... }: +{ + programs.neovim = { + enable = true; + vimAlias = true; + viAlias = true; + }; +} diff --git a/modules/home/packages.nix b/modules/home/packages.nix index cb4bdea..7ff41b3 100644 --- a/modules/home/packages.nix +++ b/modules/home/packages.nix @@ -2,9 +2,10 @@ { home.packages = with pkgs; [ + git + zsh neofetch btop - zsh wl-clipboard kitty vim diff --git a/modules/home/zsh/plugins.nix b/modules/home/zsh/plugins.nix new file mode 100644 index 0000000..c12d828 --- /dev/null +++ b/modules/home/zsh/plugins.nix @@ -0,0 +1,6 @@ +{ + programs.zsh.plugins = [ + { + + } +}