diff --git a/default.nix b/default.nix index 2eccc6f6..fd878303 100644 --- a/default.nix +++ b/default.nix @@ -1,4 +1,4 @@ -{ home-manager, stylix, lib, ... }: +{ home-manager, stylix, ... }: { imports = [ @@ -12,12 +12,4 @@ ./specializations ./src/main.nix ]; - - options.variables = { - hostname = lib.mkOption { default = "nixos"; }; - hostHardwareConfiguration = lib.mkOption { default = ./hardware/laptop.nix; }; - stateVersion = lib.mkOption { default = "22.11"; }; - username = lib.mkOption { default = "user"; }; - defaultBrowser = lib.mkOption { default = "librewolf"; }; - }; } diff --git a/home/git.nix b/home/git.nix index 447de7dc..cd9da303 100644 --- a/home/git.nix +++ b/home/git.nix @@ -1,4 +1,4 @@ -{ pkgs, config, ... }: +{ pkgs, ... }: { home.packages = with pkgs; [ tig ]; @@ -22,7 +22,7 @@ quotePath = false; }; - web.browser = config.variables.defaultBrowser; + web.browser = "librewolf"; push.default = "simple"; branch.autosetuprebase = "always"; init.defaultBranch = "master"; diff --git a/home/hyprland.nix b/home/hyprland.nix index 4724456e..ee219301 100644 --- a/home/hyprland.nix +++ b/home/hyprland.nix @@ -1,9 +1,9 @@ -{ pkgs, config, ... }: +{ pkgs, ... }: { xdg.configFile."hypr/hyprland.conf".text = /* bash */ '' env=XCURSOR_SIZE,24 - env=BROWSER,${config.variables.defaultBrowser} + env=BROWSER,librewolf env=GTK_IM_MODULE,fcitx env=QT_IM_MODULE,fcitx env=XMODIFIERS,@im=fcitx diff --git a/home/kitty.nix b/home/kitty.nix index 0ba935b3..e7e104a4 100644 --- a/home/kitty.nix +++ b/home/kitty.nix @@ -1,4 +1,4 @@ -{ config, ... }: { +{ programs.kitty = { enable = true; @@ -7,7 +7,7 @@ close_on_child_death = true; cursor_blink_interval = 0; - open_url_with = config.variables.defaultBrowser; + open_url_with = "librewolf"; wayland_titlebar_color = "background"; allow_remote_control = true; diff --git a/home/mime-apps.nix b/home/mime-apps.nix index 6ba401c4..66531939 100644 --- a/home/mime-apps.nix +++ b/home/mime-apps.nix @@ -1,4 +1,4 @@ -{ config, ... }: { +{ xdg.mimeApps = { enable = true; @@ -7,8 +7,8 @@ "image/jpeg" = "feh.desktop"; "image/gif" = "org.qutebrowser.qutebrowser.desktop"; "application/x-wine-extension-osz" = "osu-stable.desktop"; - "x-scheme-handler/http" = "${config.variables.defaultBrowser}.desktop"; - "x-scheme-handler/https" = "${config.variables.defaultBrowser}.desktop"; + "x-scheme-handler/http" = "librewolf.desktop"; + "x-scheme-handler/https" = "librewolf.desktop"; }; }; } diff --git a/home/ncmpcpp.nix b/home/ncmpcpp.nix index 7872aa1f..a007b40b 100644 --- a/home/ncmpcpp.nix +++ b/home/ncmpcpp.nix @@ -1,11 +1,11 @@ -{ pkgs, config, ... }: +{ pkgs, ... }: { home.packages = with pkgs; [ mpc-cli ]; services.mpd = { enable = true; - musicDirectory = "/home/${config.variables.username}/Music"; + musicDirectory = "/home/user/Music"; }; xdg.configFile = { diff --git a/home/xdg-user-dirs.nix b/home/xdg-user-dirs.nix index 3a510400..73886d1a 100644 --- a/home/xdg-user-dirs.nix +++ b/home/xdg-user-dirs.nix @@ -1,4 +1,4 @@ -{ config, ... }: { +{ xdg.userDirs = { enable = true; @@ -6,11 +6,11 @@ templates = null; publicShare = null; - download = "/home/${config.variables.username}/ダウンロード"; - documents = "/home/${config.variables.username}/ドキュメント"; - music = "/home/${config.variables.username}/音楽"; - pictures = "/home/${config.variables.username}/画像"; - videos = "/home/${config.variables.username}/ビデオ"; + download = "/home/user/ダウンロード"; + documents = "/home/user/ドキュメント"; + music = "/home/user/音楽"; + pictures = "/home/user/画像"; + videos = "/home/user/ビデオ"; }; xdg.configFile."user-dirs.locale".text = "ja_JP"; diff --git a/modules/fish.nix b/modules/fish.nix index 875b16c1..45a60e3d 100644 --- a/modules/fish.nix +++ b/modules/fish.nix @@ -1,4 +1,4 @@ -{ pkgs, config, ... }: +{ pkgs, ... }: { users.defaultUserShell = pkgs.fish; @@ -76,7 +76,7 @@ jis = "recode shift_jis..utf8"; # Easily convert shift_jis-encoded files to utf8 utf16 = "recode utf16..utf8"; # Rarely, some files from Japan are utf16 instead jp = "LANG=ja_JP.UTF-8 LC_ALL=ja_JP.UTF-8"; - vm = /* fish */ ''cd ~/nix-config && crystal spec tests/main.cr --progress --verbose --tag local && nixos-rebuild build-vm --flake . --verbose && ./result/bin/run-${config.variables.hostname}-vm && trash put result ${config.variables.hostname}.qcow2''; + vm = /* fish */ ''cd ~/nix-config && crystal spec tests/main.cr --progress --verbose --tag local && nixos-rebuild build-vm --flake . --verbose && ./result/bin/run-nixos-vm && trash put result nixos.qcow2''; sw = "cd ~/nix-config && crystal spec tests/main.cr --progress --verbose --tag local && sudo nixos-rebuild switch --flake . --verbose"; st = "cd ~/nix-config && crystal spec tests/main.cr --progress --verbose --tag local"; tf = "treefmt"; diff --git a/modules/greetd.nix b/modules/greetd.nix index 887b2ce6..2b40679f 100644 --- a/modules/greetd.nix +++ b/modules/greetd.nix @@ -1,4 +1,6 @@ -{ pkgs, config, ... }: { +{ pkgs, ... }: + +{ services.greetd = { enable = true; restart = false; @@ -9,7 +11,7 @@ }; initial_session = { command = "${pkgs.hyprland}/bin/Hyprland"; - user = config.variables.username; + user = "user"; }; }; }; diff --git a/modules/home-manager.nix b/modules/home-manager.nix index 96edf18f..39bca920 100644 --- a/modules/home-manager.nix +++ b/modules/home-manager.nix @@ -1,16 +1,16 @@ -{ config, ... }: { +{ home-manager = { useGlobalPkgs = true; useUserPackages = true; sharedModules = [{ - home.stateVersion = config.variables.stateVersion; + home.stateVersion = "22.11"; }]; users = { user = { - home.username = config.variables.username; - home.homeDirectory = "/home/${config.variables.username}"; + home.username = "user"; + home.homeDirectory = "/home/user"; }; }; }; diff --git a/modules/networking.nix b/modules/networking.nix index 6821cb5d..72a262c5 100644 --- a/modules/networking.nix +++ b/modules/networking.nix @@ -1,6 +1,6 @@ -{ config, ... }: { +{ networking = { - hostName = config.variables.hostname; + hostName = "nixos"; networkmanager = { enable = true; diff --git a/modules/user.nix b/modules/user.nix index 96156401..03ce7872 100644 --- a/modules/user.nix +++ b/modules/user.nix @@ -1,12 +1,14 @@ -{ config, ... }: { +{ users = { mutableUsers = false; - users."${config.variables.username}" = { - isNormalUser = true; - uid = 1000; - password = "user"; - extraGroups = [ "wheel" "networkmanager" ]; + users = { + user = { + isNormalUser = true; + uid = 1000; + password = "user"; + extraGroups = [ "wheel" "networkmanager" ]; + }; }; }; } diff --git a/src/main.nix b/src/main.nix index dbbe0ba1..d8a4a707 100644 --- a/src/main.nix +++ b/src/main.nix @@ -1,4 +1,4 @@ -{ pkgs, lib, config, ... }: { +{ pkgs, lib, ... }: { environment.systemPackages = with pkgs; [ grimblast waycorner @@ -88,5 +88,5 @@ ]; environment.defaultPackages = [ ]; - system.stateVersion = config.varables.stateVersion; + system.stateVersion = "22.11"; }