From 37fed6d9d80259fa4f84aec2a32b255f18f051aa Mon Sep 17 00:00:00 2001 From: ark-lamp-umbrella Date: Sun, 21 Apr 2024 23:13:41 -0700 Subject: [PATCH] home.nix --- configuration.nix | 117 +--------------------- flake.lock | 22 +++++ flake.nix | 12 ++- fonts.nix | 4 - home.nix | 245 ++++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 279 insertions(+), 121 deletions(-) create mode 100644 home.nix diff --git a/configuration.nix b/configuration.nix index 88c0024..3b52449 100644 --- a/configuration.nix +++ b/configuration.nix @@ -2,19 +2,12 @@ # your system. Help is available in the configuration.nix(5) man page # and in the NixOS manual (accessible by running ‘nixos-help’). -{ pkgs, lib, ... }: -let - home-manager = builtins.fetchTarball "https://github.com/nix-community/home-manager/archive/master.tar.gz"; -in +{ pkgs, ... }: { imports = [ ./hardware-configuration.nix - ./firefox/firefox.nix - ./alacritty/alacritty.nix - ./hyprland/hyprland.nix ./fonts.nix - (import "${home-manager}/nixos") ]; @@ -146,114 +139,6 @@ in enable = true; extraPortals = [ pkgs.xdg-desktop-portal-gtk ]; }; - - home-manager.users.ark = { - /* The home.stateVersion option does not have a default and must be set */ - home.stateVersion = "24.05"; - /* Here goes the rest of your home-manager config, e.g. home.packages = [ pkgs.foo ]; */ - - home.packages = [ - pkgs.bun # bun js runtime - pkgs.elixir # elixir lang - pkgs.blender # blender 3d tool - pkgs.prismlauncher # Minecraft launcher - pkgs.zulu17 # Java 17 binary - pkgs.janet # Janet lang, for later testing - pkgs.uxn # uxn tools from 100r - pkgs.onefetch # git neofetch-type tool - pkgs.elixir-ls # elixir lsp (maybe replace?) - pkgs.erlang-ls # erlang lsp - pkgs.zls # zig lsp - pkgs.nil # nix lsp - pkgs.pfetch-rs - pkgs.gimp - ]; - services = { - dunst = { - enable = true; - }; - }; - programs = { - hyfetch = { - enable = true; - settings = { - preset = "transfeminine"; - mode = "rgb"; - light_dark = "dark"; - lightness = 0.5; - color_align = { - mode = "horizontal"; - custom_colors = []; - fore_back = null; - }; - backend = "neofetch"; - args = null; - distro = null; - pride_month_shown = []; - pride_month_disable = false; - }; - }; - wofi = { - enable = true; - }; - lsd = { - enable = true; - }; - helix = { - enable = true; - defaultEditor = true; - settings = { - theme = "base16-terminal"; - editor = { - mouse = false; - line-number = "relative"; - cursorline = true; - color-modes = true; - cursor-shape = { - insert = "bar"; - normal = "block"; - select = "underline"; - }; - indent-guides = { - render = true; - }; - }; - }; - }; - starship = { - enable = true; - enableFishIntegration = true; - settings = { - add_newline = false; - format = lib.concatStrings [ - "$character" - "$directory" - ]; - character = { - success_symbol = "▲"; - error_symbol = "△"; - }; - elixir = { - symbol = ""; - }; - }; - }; - git = { - enable = true; - userName = "ark-lamp-umbrella"; - userEmail = "ark-lamp-umbrella@noreply.codeberg.org"; - extraConfig = { - push = { - autoSetupRemote = true; - }; - }; - signing = { - key = "15078E3940CB5C65B450A86D15E48F7B97025652"; - signByDefault = true; - }; - }; - }; - }; security.polkit.enable = true; programs.fish = { enable = true; diff --git a/flake.lock b/flake.lock index 5498109..f5d56d3 100644 --- a/flake.lock +++ b/flake.lock @@ -1,5 +1,26 @@ { "nodes": { + "home-manager": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1713732794, + "narHash": "sha256-AYCofb8Zu4Mbc1lHDtju/uxeARawRijmOueAqEMEfMU=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "670d9ecc3e46a6e3265c203c2d136031a3d3548e", + "type": "github" + }, + "original": { + "owner": "nix-community", + "ref": "master", + "repo": "home-manager", + "type": "github" + } + }, "nixpkgs": { "locked": { "lastModified": 1713537308, @@ -18,6 +39,7 @@ }, "root": { "inputs": { + "home-manager": "home-manager", "nixpkgs": "nixpkgs" } } diff --git a/flake.nix b/flake.nix index 38cbf88..50b6bf0 100644 --- a/flake.nix +++ b/flake.nix @@ -6,14 +6,24 @@ nixpkgs = { url = "github:NixOS/nixpkgs/nixos-unstable"; }; + home-manager = { + url = "github:nix-community/home-manager/master"; + inputs.nixpkgs.follows = "nixpkgs"; + }; }; - outputs = { self, nixpkgs }: { + outputs = inputs@{ nixpkgs, home-manager, ... }: { nixosConfigurations = { ark-desktop-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.ark = import ./home.nix; + } ]; }; }; diff --git a/fonts.nix b/fonts.nix index 7617ade..980d2a7 100644 --- a/fonts.nix +++ b/fonts.nix @@ -3,11 +3,7 @@ # and in the NixOS manual (accessible by running ‘nixos-help’). { pkgs, ... }: -let - home-manager = builtins.fetchTarball "https://github.com/nix-community/home-manager/archive/master.tar.gz"; -in { - imports = [ (import "${home-manager}/nixos") ]; fonts.fontconfig.enable = true; fonts.packages = with pkgs; [ cozette diff --git a/home.nix b/home.nix new file mode 100644 index 0000000..f06295a --- /dev/null +++ b/home.nix @@ -0,0 +1,245 @@ +{ config, pkgs, ... }: + +{ + home.username = "ark"; + home.homeDirectory = "/home/ark"; + home.packages = [ + pkgs.bun # bun js runtime + pkgs.elixir # elixir lang + pkgs.blender # blender 3d tool + pkgs.prismlauncher # Minecraft launcher + pkgs.zulu17 # Java 17 binary + pkgs.janet # Janet lang, for later testing + pkgs.uxn # uxn tools from 100r + pkgs.onefetch # git neofetch-type tool + pkgs.elixir-ls # elixir lsp (maybe replace?) + pkgs.erlang-ls # erlang lsp + pkgs.zls # zig lsp + pkgs.nil # nix lsp + pkgs.pfetch-rs + pkgs.gimp + ]; + services = { + dunst = { + enable = true; + }; + }; + programs = { + wpaperd = { + enable = true; + settings = { + default = { + path = "/etc/nixos/wallpapers/nix-black-4k.png"; + apply-shadow = true; + }; + }; + }; + wayland.windowManager.hyprland = { + enable = true; + xwayland = { + enable = true; + }; + settings = { + "$mod" = "SUPER"; + "$terminal" = "alacritty"; + bind = [ + "$mod, S, exec, wofi --show drun --allow-images" + "$mod, Q, exec, $terminal" + "$mod, M, exit," + "$mod, 1, workspace, 1" + "$mod, 2, workspace, 2" + "$mod, 3, workspace, 3" + "$mod, 4, workspace, 4" + "$mod, 5, workspace, 5" + "$mod, 6, workspace, 6" + "$mod, 7, workspace, 7" + "$mod, 8, workspace, 8" + "$mod, 9, workspace, 9" + "$mod, 0, workspace, 10" + "$mod SHIFT, 1, movetoworkspace, 1" + "$mod SHIFT, 2, movetoworkspace, 2" + "$mod SHIFT, 3, movetoworkspace, 3" + "$mod SHIFT, 4, movetoworkspace, 4" + "$mod SHIFT, 5, movetoworkspace, 5" + "$mod SHIFT, 6, movetoworkspace, 6" + "$mod SHIFT, 7, movetoworkspace, 7" + "$mod SHIFT, 8, movetoworkspace, 8" + "$mod SHIFT, 9, movetoworkspace, 9" + "$mod SHIFT, 0, movetoworkspace, 10" + ]; + bindm = [ + "$mod, mouse:272, movewindow" + "$mod, mouse:273, resizewindow" + ]; + exec-once = [ + "udiskie" + "wpaperd" + "dunst" + "lxqt-policykit-agent" + "nm-applet --indicator" + "waybar" + ]; + decoration = { + rounding = 0; + }; + }; + }; + firefox = { + enable = true; + profiles.default = { + id = 0; + name = "default"; + isDefault = true; + search.force = true; + search.default = "LibRedirect"; + search.privateDefault = "LibRedirect"; + settings = { + "toolkit.legacyUserProfileCustomizations.stylesheets" = true; + "browser.toolbars.bookmarks.visibility" = "never"; + "signon.rememberSignons" = false; + }; + containersForce = true; + containers = { + "school" = { + id = 0; + color = "red"; + icon = "fruit"; + }; + }; + extensions = with pkgs.nur.repos.rycee.firefox-addons; [ + ublock-origin + bitwarden + libredirect + sidebery + stylus + firefox-color + tabliss + ]; + bookmarks = [ + { + name = "nixos"; + bookmarks = [ + { + name = "nixos packages"; + url = "https://search.nixos.org"; + } + { + name = "home manager wiki"; + url = "https://nix-community.github.io/home-manager"; + } + ]; + } + ]; + userChrome = builtins.readFile ./userChrome.css; + }; + }; + alacritty = { + enable = true; + settings = { + window = { + padding = { + x = 4; + y = 4; + }; + }; + font = { + size = 14; + normal = { + family = "CozetteVector"; + style = "Medium"; + }; + bold = { + family = "CozetteVectorBold"; + style = "Medium"; + }; + italic = { + family = "CozetteVector"; + style = "Medium"; + }; + bold_italic = { + family = "CozetteVectorBold"; + style = "Medium"; + }; + }; + }; + }; + hyfetch = { + enable = true; + settings = { + preset = "transfeminine"; + mode = "rgb"; + light_dark = "dark"; + lightness = 0.5; + color_align = { + mode = "horizontal"; + custom_colors = []; + fore_back = null; + }; + backend = "neofetch"; + args = null; + distro = null; + pride_month_shown = []; + pride_month_disable = false; + }; + }; + wofi = { + enable = true; + }; + lsd = { + enable = true; + }; + helix = { + enable = true; + defaultEditor = true; + settings = { + theme = "base16-terminal"; + editor = { + mouse = false; + line-number = "relative"; + cursorline = true; + color-modes = true; + cursor-shape = { + insert = "bar"; + normal = "block"; + select = "underline"; + }; + indent-guides = { + render = true; + }; + }; + }; + }; + starship = { + enable = true; + enableFishIntegration = true; + settings = { + add_newline = false; + format = lib.concatStrings [ + "$character" + "$directory" + ]; + character = { + success_symbol = "▲"; + error_symbol = "△"; + }; + elixir = { + symbol = ""; + }; + }; + }; + git = { + enable = true; + userName = "ark-lamp-umbrella"; + userEmail = "ark-lamp-umbrella@noreply.codeberg.org"; + extraConfig = { + push = { + autoSetupRemote = true; + }; + }; + signing = { + key = "15078E3940CB5C65B450A86D15E48F7B97025652"; + signByDefault = true; + }; + }; + }; +}