From d80a288389451c3bcbad4746c0f391a6930417db Mon Sep 17 00:00:00 2001 From: caandt Date: Fri, 23 Aug 2024 13:52:05 -0500 Subject: [PATCH] init home manager --- configuration.nix | 53 ----------------------------------------------- flake.lock | 22 ++++++++++++++++++++ flake.nix | 11 +++++++++- home.nix | 52 ++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 84 insertions(+), 54 deletions(-) create mode 100644 home.nix diff --git a/configuration.nix b/configuration.nix index ef026ff..c0c7183 100644 --- a/configuration.nix +++ b/configuration.nix @@ -80,39 +80,6 @@ users.users.ahnwuoa = { isNormalUser = true; extraGroups = [ "wheel" ]; - packages = with pkgs; [ - firefox - alacritty - mpv - nsxiv - rofi - sct - maim - xclip - libsForQt5.kcalc - libsForQt5.kolourpaint - libsForQt5.filelight - papirus-icon-theme - pavucontrol - qpwgraph - - gdb - lsd - bat - zoxide - fd - ripgrep - fzf - trash-cli - tlrc - micro - speedtest-cli - bluetuith - unixtools.xxd - - python3 - gnumake - ]; }; programs.partition-manager = { enable = true; @@ -138,27 +105,7 @@ fcitx5-gtk ]; }; - qt = { - enable = true; - platformTheme = "qt5ct"; - style = "breeze"; - }; security.polkit.enable = true; - systemd = { - user.services.polkit-kde-authentication-agent-1 = { - description = "polkit-kde-authentication-agent-1"; - wantedBy = [ "graphical-session.target" ]; - wants = [ "graphical-session.target" ]; - after = [ "graphical-session.target" ]; - serviceConfig = { - Type = "simple"; - ExecStart = "${pkgs.libsForQt5.polkit-kde-agent}/libexec/polkit-kde-authentication-agent-1"; - Restart = "on-failure"; - RestartSec = 1; - TimeoutStopSec = 10; - }; - }; - }; system.stateVersion = "24.05"; } diff --git a/flake.lock b/flake.lock index 0d6a636..e5c0881 100644 --- a/flake.lock +++ b/flake.lock @@ -1,5 +1,26 @@ { "nodes": { + "home-manager": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1720042825, + "narHash": "sha256-A0vrUB6x82/jvf17qPCpxaM+ulJnD8YZwH9Ci0BsAzE=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "e1391fb22e18a36f57e6999c7a9f966dc80ac073", + "type": "github" + }, + "original": { + "owner": "nix-community", + "ref": "release-24.05", + "repo": "home-manager", + "type": "github" + } + }, "nixpkgs": { "locked": { "lastModified": 1723556749, @@ -18,6 +39,7 @@ }, "root": { "inputs": { + "home-manager": "home-manager", "nixpkgs": "nixpkgs" } } diff --git a/flake.nix b/flake.nix index 13f8d88..7fb9b3e 100644 --- a/flake.nix +++ b/flake.nix @@ -3,13 +3,22 @@ inputs = { nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.05"; + home-manager = { + url = "github:nix-community/home-manager/release-24.05"; + inputs.nixpkgs.follows = "nixpkgs"; + }; }; - outputs = { nixpkgs, ... }@inputs: { + outputs = { nixpkgs, home-manager, ... }@inputs: { nixosConfigurations.nixos = nixpkgs.lib.nixosSystem { system = "x86_64-linux"; modules = [ ./configuration.nix + home-manager.nixosModules.home-manager { + home-manager.useGlobalPkgs = true; + home-manager.useUserPackages = true; + home-manager.users.ahnwuoa = import ./home.nix; + } ]; }; }; diff --git a/home.nix b/home.nix new file mode 100644 index 0000000..df52a68 --- /dev/null +++ b/home.nix @@ -0,0 +1,52 @@ +{ config, pkgs, ... }: + +let + username = "ahnwuoa"; + homeDirectory = "/home/${username}"; +in +{ + home.username = username; + home.homeDirectory = homeDirectory; + + home.packages = with pkgs; [ + firefox + alacritty + mpv + nsxiv + rofi + sct + maim + xclip + libsForQt5.kcalc + libsForQt5.kolourpaint + libsForQt5.filelight + papirus-icon-theme + pavucontrol + qpwgraph + + gdb + lsd + bat + zoxide + fd + ripgrep + fzf + trash-cli + tlrc + micro + speedtest-cli + bluetuith + unixtools.xxd + starship + + python3 + gnumake + ]; + qt = { + enable = true; + platformTheme.name = "qtct"; + style.name = "breeze"; + style.package = pkgs.libsForQt5.breeze-qt5; + }; + home.stateVersion = "24.05"; +}