diff --git a/README.md b/README.md index 42aa7135..8462d06d 100644 --- a/README.md +++ b/README.md @@ -78,7 +78,6 @@ nix flake show 'github:kachick/dotfiles' --json | jq '.nixosConfigurations | key Candidates - `user@linux-cli` # Used in container - - `kachick@linux-gui` ### Podman on Ubuntu diff --git a/flake.nix b/flake.nix index c4c07d57..1c3b0ff8 100644 --- a/flake.nix +++ b/flake.nix @@ -148,7 +148,6 @@ nixosConfigurations = let system = "x86_64-linux"; - pkgs = import nixpkgs { inherit system; }; edge-pkgs = import edge-nixpkgs { inherit system; config = { @@ -158,22 +157,6 @@ homemade-pkgs = homemade-packages.${system}; shared = { inherit system; - modules = [ - ./nixos/configuration.nix - home-manager.nixosModules.home-manager - { - home-manager = { - useGlobalPkgs = true; - useUserPackages = true; - backupFileExtension = "backup"; - # FIXME: Apply gnome.nix in #680 - users.kachick = import ./home-manager/kachick.nix; - extraSpecialArgs = { - inherit homemade-pkgs edge-pkgs; - }; - }; - } - ]; specialArgs = { inherit inputs @@ -185,15 +168,9 @@ }; in { - "moss" = nixpkgs.lib.nixosSystem ( - shared // { modules = shared.modules ++ [ ./nixos/hosts/moss ]; } - ); - - "algae" = nixpkgs.lib.nixosSystem ( - shared // { modules = shared.modules ++ [ ./nixos/hosts/algae ]; } - ); - - "wsl" = nixpkgs.lib.nixosSystem (shared // { modules = shared.modules ++ [ ./nixos/hosts/wsl ]; }); + "moss" = nixpkgs.lib.nixosSystem (shared // { modules = [ ./nixos/hosts/moss ]; }); + "algae" = nixpkgs.lib.nixosSystem (shared // { modules = [ ./nixos/hosts/algae ]; }); + "wsl" = nixpkgs.lib.nixosSystem (shared // { modules = [ ./nixos/hosts/wsl ]; }); }; homeConfigurations = @@ -223,17 +200,6 @@ }; in { - "kachick@linux-gui" = home-manager.lib.homeManagerConfiguration ( - x86-Linux - // { - modules = [ - ./home-manager/kachick.nix - ./home-manager/systemd.nix - ./home-manager/gnome.nix - ]; - } - ); - "kachick@wsl" = home-manager.lib.homeManagerConfiguration ( x86-Linux // { diff --git a/nixos/configuration.nix b/nixos/configuration.nix index ef99c0e8..154025c1 100644 --- a/nixos/configuration.nix +++ b/nixos/configuration.nix @@ -10,24 +10,10 @@ lib, ... }: -let - # https://github.com/NixOS/nixpkgs/issues/309662#issuecomment-2155122284 - zed-fhs = pkgs.buildFHSUserEnv { - name = "zed"; - targetPkgs = pkgs: [ - # version in nixos-24.05 does not enable IME - edge-pkgs.zed-editor - ]; - runScript = "zed"; - meta.mainProgram = "zed"; - }; -in { imports = [ ./modules/cloudflare-warp.nix - (import ./font.nix { inherit pkgs homemade-pkgs; }) (import ./console.nix { inherit homemade-pkgs; }) - (import ./language.nix { inherit config pkgs; }) ]; nix.settings.experimental-features = [ @@ -63,7 +49,7 @@ in }; }; - # Set your time zone. + # TODO: Reconsider to set UTC for servers time.timeZone = "Asia/Tokyo"; # Allow unfree packages @@ -71,17 +57,10 @@ in nixpkgs.config.allowUnfree = true; environment.sessionVariables = { - MOZ_ENABLE_WAYLAND = "1"; SSH_ASKPASS_REQUIRE = "prefer"; - NIXOS_OZONE_WL = "1"; - - # Avoiding hidden or unstable mouse cursors when using Alacritty/Wezterm on Wayland - # - # https://github.com/NixOS/nixpkgs/issues/22652 - # https://github.com/alacritty/alacritty/issues/6703#issuecomment-2222503206 - XCURSOR_THEME = "Adwaita"; }; + # TODO: Reconsider to drop this services.packagekit = { enable = true; }; @@ -91,7 +70,6 @@ in hardware.bluetooth.enable = true; # enables support for Bluetooth hardware.bluetooth.powerOnBoot = true; # powers up the default Bluetooth controller on boot - services.blueman.enable = true; # Enable sound with pipewire. sound.enable = true; @@ -116,51 +94,21 @@ in package = edge-pkgs.cloudflare-warp; }; - # Define a user account. Don't forget to set a password with ‘passwd’. - users.users = { - kachick = { - isNormalUser = true; - description = "An admin"; - extraGroups = [ - "networkmanager" - "wheel" - "input" # For finger print in GDM - ]; - packages = [ - # Don't install spotify, it does not activate IME and no binary cache with the unfree license. - # Use Web Player or PWA - ]; - }; - }; - environment.variables = { - # Don't set *IM_MODULE in KDE: https://discuss.kde.org/t/kde-plasma-wayland/9014 - # QT_IM_MODULE = "fcitx"; - XMODIFIERS = "@im=fcitx"; - EDITOR = lib.getExe pkgs.helix; SYSTEMD_EDITOR = lib.getExe pkgs.helix; - VISUAL = "${lib.getExe zed-fhs} --wait"; }; # List packages installed in system profile. To search, run: # $ nix search wget environment.systemPackages = - with pkgs; - [ + (with pkgs; [ vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default. helix micro - zed-fhs - lapce # IME is not working on Windows, but stable even around IME on Wayland than vscode usbutils # `lsusb` to get IDs - skk-dicts - skktools - - alacritty - wget curl git @@ -172,10 +120,6 @@ in ripgrep dig - # 3rd-party bitwarden helper, because of official cli does not have many core features - # Use latest because of nixos-24.05 distributing version has a crucial bug: https://github.com/quexten/goldwarden/issues/190 - edge-pkgs.goldwarden - # Clipboard # # Don't use clipcat, copyq for wayland problem @@ -184,108 +128,19 @@ in # # So use a clipboard gnome extension - # https://github.com/NixOS/nixpkgs/issues/33282 - xdg-user-dirs - # Use stable packages even for GUI apps, because of using home-manager stable channel - firefox - - # Don't use unstable channel. It frequently backported to stable channel - # - https://github.com/NixOS/nixpkgs/commits/nixos-24.05/pkgs/applications/networking/instant-messengers/signal-desktop/signal-desktop.nix - (signal-desktop.overrideAttrs (prev: { - preFixup = - prev.preFixup - + '' - gappsWrapperArgs+=( - --add-flags "--enable-features=UseOzonePlatform" - --add-flags "--ozone-platform=wayland" - --add-flags "--enable-wayland-ime" - --add-flags "--disable-features=WaylandFractionalScaleV1" - ) - ''; - })) - podman-tui docker-compose chawan - - gnome.dconf-editor - - # https://github.com/NixOS/nixpkgs/issues/174353 - Super + / runs launcher by default - pop-launcher - - nordic - - ## Unfree packages - - # TODO: Consider using vscodium again - # TODO: Consider to drop the unuseful vscode until fixed the Wayland problems - # Don't use unstable channel. It frequently backported to stable channel - # - https://github.com/NixOS/nixpkgs/commits/nixos-24.05/pkgs/applications/editors/vscode/vscode.nix - (vscode.override (prev: { - # https://wiki.archlinux.org/title/Wayland#Electron - # https://github.com/NixOS/nixpkgs/blob/3f8b7310913d9e4805b7e20b2beabb27e333b31f/pkgs/applications/editors/vscode/generic.nix#L207-L214 - commandLineArgs = (prev.commandLineArgs or [ ]) ++ [ - "--enable-features=UseOzonePlatform" - "--ozone-platform=wayland" - "--enable-wayland-ime" - # https://github.com/microsoft/vscode/issues/192590#issuecomment-1731312805 - # This bug appeared only when using GNOME, not in KDE - "--disable-features=WaylandFractionalScaleV1" - ]; - })) - - # Don't use unstable channel. It frequently backported to stable channel - # - https://github.com/NixOS/nixpkgs/commits/nixos-24.05/pkgs/by-name/go/google-chrome/package.nix - # - Actually unstable is/was broken. See GH-776 - # - # if you changed hostname and chrome doesn't run, see https://askubuntu.com/questions/476918/google-chrome-wont-start-after-changing-hostname - # `rm -rf ~/.config/google-chrome/Singleton*` - (google-chrome.override (prev: { - # https://wiki.archlinux.org/title/Chromium#Native_Wayland_support - # Similar as https://github.com/nix-community/home-manager/blob/release-24.05/modules/programs/chromium.nix - commandLineArgs = (prev.commandLineArgs or [ ]) ++ [ - "--ozone-platform=wayland" - "--ozone-platform-hint=auto" - "--enable-wayland-ime" - ]; - })) - ] - ++ (with pkgs.gnomeExtensions; [ - appindicator - - # Should be changed from default CSS to another to avoid https://github.com/pop-os/shell/issues/132 - # https://github.com/pop-os/shell/blob/cfa0c55e84b7ce339e5ce83832f76fee17e99d51/light.css#L20-L24 - # Apple same color as nord(Nordic) https://github.com/EliverLara/Nordic/blob/5c53654fb6f3e0266ad8c481a099091e92f28274/gnome-shell/_colors.scss#L14-L15 - (pop-shell.overrideAttrs (prev: { - preFixup = - prev.preFixup - + '' - echo '.pop-shell-search-element:select{ background: #8fbcbb !important; color: #fefefe !important; }' >> $out/share/gnome-shell/extensions/pop-shell@system76.com/light.css - ''; - })) - clipboard-history - kimpanel - just-perfection - dash-to-dock - color-picker - xremap + ]) + ++ (with edge-pkgs; [ + # 3rd-party bitwarden helper, because of official cli does not have many core features + # Use latest because of nixos-24.05 distributing version has a crucial bug: https://github.com/quexten/goldwarden/issues/190 + goldwarden ]); - # https://github.com/NixOS/nixpkgs/issues/33282#issuecomment-523572259 - environment.etc."xdg/user-dirs.defaults".text = '' - DESKTOP=Desktop - DOCUMENTS=Documents - DOWNLOAD=Downloads - MUSIC=Music - PICTURES=Pictures - PUBLICSHARE=Public - TEMPLATES=Templates - VIDEOS=Videos - ''; - # Some programs need SUID wrappers, can be configured further or are # started in user sessions. # programs.mtr.enable = true; @@ -305,16 +160,7 @@ in # Or disable the firewall altogether. # networking.firewall.enable = false; - programs.nix-ld.enable = false; - - # https://github.com/NixOS/nixpkgs/blob/nixos-24.05/nixos/modules/programs/firefox.nix - programs.firefox = { - enable = true; - languagePacks = [ - "en-US" - "ja" - ]; - }; + # programs.nix-ld.enable = false; # Prefer NixOS modules rather than home-manager for easy setting up programs.goldwarden = { @@ -335,4 +181,22 @@ in defaultNetwork.settings.dns_enabled = true; }; }; + + # TODO: Reconsider to set C or EN for servers + # Select internationalisation properties. + i18n = { + defaultLocale = "ja_JP.UTF-8"; + + extraLocaleSettings = { + LC_ADDRESS = "ja_JP.UTF-8"; + LC_IDENTIFICATION = "ja_JP.UTF-8"; + LC_MEASUREMENT = "ja_JP.UTF-8"; + LC_MONETARY = "ja_JP.UTF-8"; + LC_NAME = "ja_JP.UTF-8"; + LC_NUMERIC = "ja_JP.UTF-8"; + LC_PAPER = "ja_JP.UTF-8"; + LC_TELEPHONE = "ja_JP.UTF-8"; + LC_TIME = "ja_JP.UTF-8"; + }; + }; } diff --git a/nixos/console.nix b/nixos/console.nix index 1d97f05c..65aaca61 100644 --- a/nixos/console.nix +++ b/nixos/console.nix @@ -1,7 +1,3 @@ -# Edit this configuration file to define what should be installed on -# your system. Help is available in the configuration.nix(5) man page -# and in the NixOS manual (accessible by running ‘nixos-help’). - { homemade-pkgs, ... }: { # https://github.com/NixOS/nixpkgs/blob/nixos-24.05/nixos/modules/config/console.nix diff --git a/nixos/GUI.md b/nixos/desktop/GUI.md similarity index 100% rename from nixos/GUI.md rename to nixos/desktop/GUI.md diff --git a/nixos/desktop/default.nix b/nixos/desktop/default.nix new file mode 100644 index 00000000..170595ba --- /dev/null +++ b/nixos/desktop/default.nix @@ -0,0 +1,299 @@ +{ + config, + inputs, + outputs, + pkgs, + edge-pkgs, + homemade-pkgs, + lib, + ... +}: + +let + # https://github.com/NixOS/nixpkgs/issues/309662#issuecomment-2155122284 + zed-fhs = pkgs.buildFHSUserEnv { + name = "zed"; + targetPkgs = pkgs: [ + # version in nixos-24.05 does not enable IME + edge-pkgs.zed-editor + ]; + runScript = "zed"; + meta.mainProgram = "zed"; + }; +in +{ + imports = [ + (import ./font.nix { inherit pkgs homemade-pkgs; }) + inputs.xremap-flake.nixosModules.default + ./xremap.nix + inputs.home-manager.nixosModules.home-manager + ]; + + # Define a user account. Don't forget to set a password with ‘passwd’. + users.users = { + kachick = { + isNormalUser = true; + description = "An admin"; + extraGroups = [ + "networkmanager" + "wheel" + "input" # For finger print in GDM + ]; + packages = [ + # Don't install spotify, it does not activate IME and no binary cache with the unfree license. + # Use Web Player or PWA + ]; + }; + }; + + home-manager = { + useGlobalPkgs = true; + useUserPackages = true; + backupFileExtension = "backup"; + users.kachick = { + imports = [ + ../../home-manager/kachick.nix + ../../home-manager/systemd.nix + ../../home-manager/gnome.nix + ]; + }; + extraSpecialArgs = { + inherit + inputs + outputs + edge-pkgs + homemade-pkgs + ; + }; + }; + + services.xserver = { + enable = true; + + # Don't use other DM like SDDM, LightDM, lemurs for now. They don't start GNOME for now... (AFAIK) + # And when I was using KDE, GDM only worked, SDDM didn't work + # https://github.com/NixOS/nixpkgs/blob/nixos-24.05/nixos/modules/services/x11/display-managers/gdm.nix + displayManager.gdm.enable = true; + # https://github.com/NixOS/nixpkgs/blob/nixos-24.05/nixos/modules/services/x11/display-managers/lightdm.nix + # displayManager.lightdm.enable = false; + + desktopManager.gnome = { + enable = true; + # https://github.com/NixOS/nixpkgs/issues/114514 + extraGSettingsOverridePackages = [ pkgs.gnome.mutter ]; + }; + + # Configure keymap in X11 + xkb = { + layout = "us"; + variant = ""; + }; + }; + + services.udev.packages = with pkgs; [ gnome.gnome-settings-daemon ]; + + programs = { + # https://github.com/nix-community/home-manager/blob/release-24.05/modules/misc/dconf.nix#L39-L42 + dconf.enable = true; + # For lanching with command looks like better than alacritty + gnome-terminal.enable = true; + }; + + environment.gnome.excludePackages = + (with pkgs; [ + gnome-tour + gnome-connections + ]) + ++ (with pkgs.gnome; [ + epiphany # web browser + geary # email reader + evince # document viewer + gnome-calendar + gnome-music # does not support flac by defaults + ]); + + # Enable touchpad support (enabled default in most desktopManager). + services.libinput = { + enable = true; + mouse.naturalScrolling = true; + touchpad.naturalScrolling = true; + }; + + services.dbus.packages = [ config.i18n.inputMethod.package ]; + + services.blueman.enable = true; + + environment.systemPackages = + [ zed-fhs ] + ++ (with pkgs; [ + firefox + + # https://github.com/NixOS/nixpkgs/issues/33282 + xdg-user-dirs + + alacritty + + # TODO: Reconsider to drop this + skk-dicts + skktools + + lapce # IME is not working on Windows, but stable even around IME on Wayland than vscode + + # gnome-music does not support flac. + # tramhao/termusic and tsirysndr/music-player does not figure how to use. + rhythmbox + + # Don't use unstable channel. It frequently backported to stable channel + # - https://github.com/NixOS/nixpkgs/commits/nixos-24.05/pkgs/applications/networking/instant-messengers/signal-desktop/signal-desktop.nix + (signal-desktop.overrideAttrs (prev: { + preFixup = + prev.preFixup + + '' + gappsWrapperArgs+=( + --add-flags "--enable-features=UseOzonePlatform" + --add-flags "--ozone-platform=wayland" + --add-flags "--enable-wayland-ime" + --add-flags "--disable-features=WaylandFractionalScaleV1" + ) + ''; + })) + + gnome.dconf-editor + + # https://github.com/NixOS/nixpkgs/issues/174353 - Super + / runs launcher by default + pop-launcher + + nordic + + ## Unfree packages + + # TODO: Consider using vscodium again + # TODO: Consider to drop the unuseful vscode until fixed the Wayland problems + # Don't use unstable channel. It frequently backported to stable channel + # - https://github.com/NixOS/nixpkgs/commits/nixos-24.05/pkgs/applications/editors/vscode/vscode.nix + (vscode.override (prev: { + # https://wiki.archlinux.org/title/Wayland#Electron + # https://github.com/NixOS/nixpkgs/blob/3f8b7310913d9e4805b7e20b2beabb27e333b31f/pkgs/applications/editors/vscode/generic.nix#L207-L214 + commandLineArgs = (prev.commandLineArgs or [ ]) ++ [ + "--enable-features=UseOzonePlatform" + "--ozone-platform=wayland" + "--enable-wayland-ime" + # https://github.com/microsoft/vscode/issues/192590#issuecomment-1731312805 + # This bug appeared only when using GNOME, not in KDE + "--disable-features=WaylandFractionalScaleV1" + ]; + })) + + # Don't use unstable channel. It frequently backported to stable channel + # - https://github.com/NixOS/nixpkgs/commits/nixos-24.05/pkgs/by-name/go/google-chrome/package.nix + # - Actually unstable is/was broken. See GH-776 + # + # if you changed hostname and chrome doesn't run, see https://askubuntu.com/questions/476918/google-chrome-wont-start-after-changing-hostname + # `rm -rf ~/.config/google-chrome/Singleton*` + (google-chrome.override (prev: { + # https://wiki.archlinux.org/title/Chromium#Native_Wayland_support + # Similar as https://github.com/nix-community/home-manager/blob/release-24.05/modules/programs/chromium.nix + commandLineArgs = (prev.commandLineArgs or [ ]) ++ [ + "--ozone-platform=wayland" + "--ozone-platform-hint=auto" + "--enable-wayland-ime" + ]; + })) + ]) + ++ (with pkgs.gnomeExtensions; [ + appindicator + + # Should be changed from default CSS to another to avoid https://github.com/pop-os/shell/issues/132 + # https://github.com/pop-os/shell/blob/cfa0c55e84b7ce339e5ce83832f76fee17e99d51/light.css#L20-L24 + # Apple same color as nord(Nordic) https://github.com/EliverLara/Nordic/blob/5c53654fb6f3e0266ad8c481a099091e92f28274/gnome-shell/_colors.scss#L14-L15 + (pop-shell.overrideAttrs (prev: { + preFixup = + prev.preFixup + + '' + echo '.pop-shell-search-element:select{ background: #8fbcbb !important; color: #fefefe !important; }' >> $out/share/gnome-shell/extensions/pop-shell@system76.com/light.css + ''; + })) + clipboard-history + kimpanel + just-perfection + dash-to-dock + color-picker + xremap + ]); + + # Make it natural scroll on KDE, not enough only in libinput + # https://github.com/NixOS/nixpkgs/issues/51875#issuecomment-846251880 + # environment.etc."X11/xorg.conf.d/30-touchpad.conf".text = '' + # Section "InputClass" + # Identifier "libinput touchpad catchall" + # MatchIsTouchpad "on" + # MatchDevicePath "/dev/input/event*" + # Driver "libinput" + # Option "NaturalScrolling" "on" + # EndSection + # ''; + + # https://askubuntu.com/a/88947 + environment.etc."gdm/PostLogin/Default".source = lib.getExe ( + pkgs.writeShellApplication { + name = "connect_cloudflare-warp"; + runtimeInputs = with edge-pkgs; [ cloudflare-warp ]; + text = '' + warp-cli connect + ''; + } + ); + + environment.variables = { + VISUAL = "${lib.getExe zed-fhs} --wait"; + + # Don't set *IM_MODULE in KDE: https://discuss.kde.org/t/kde-plasma-wayland/9014 + # QT_IM_MODULE = "fcitx"; + XMODIFIERS = "@im=fcitx"; + }; + + environment.sessionVariables = { + MOZ_ENABLE_WAYLAND = "1"; + NIXOS_OZONE_WL = "1"; + + # Avoiding hidden or unstable mouse cursors when using Alacritty/Wezterm on Wayland + # + # https://github.com/NixOS/nixpkgs/issues/22652 + # https://github.com/alacritty/alacritty/issues/6703#issuecomment-2222503206 + XCURSOR_THEME = "Adwaita"; + }; + + # https://github.com/NixOS/nixpkgs/issues/33282#issuecomment-523572259 + environment.etc."xdg/user-dirs.defaults".text = '' + DESKTOP=Desktop + DOCUMENTS=Documents + DOWNLOAD=Downloads + MUSIC=Music + PICTURES=Pictures + PUBLICSHARE=Public + TEMPLATES=Templates + VIDEOS=Videos + ''; + + # https://github.com/NixOS/nixpkgs/blob/nixos-24.05/nixos/modules/programs/firefox.nix + programs.firefox = { + enable = true; + languagePacks = [ + "en-US" + "ja" + ]; + }; + + i18n = { + inputMethod = { + enabled = "fcitx5"; + + fcitx5.addons = [ + pkgs.fcitx5-mozc + pkgs.fcitx5-gtk + ]; + + fcitx5.waylandFrontend = true; + }; + }; +} diff --git a/nixos/font.nix b/nixos/desktop/font.nix similarity index 60% rename from nixos/font.nix rename to nixos/desktop/font.nix index 4b226c3f..6a01ed03 100644 --- a/nixos/font.nix +++ b/nixos/desktop/font.nix @@ -1,7 +1,3 @@ -# Edit this configuration file to define what should be installed on -# your system. Help is available in the configuration.nix(5) man page -# and in the NixOS manual (accessible by running ‘nixos-help’). - { pkgs, homemade-pkgs, ... }: { fonts = { @@ -15,23 +11,27 @@ # ``` fontDir.enable = true; - packages = with pkgs; [ - ibm-plex - plemoljp-nf - inconsolata - mplus-outline-fonts.githubRelease - # sarasa-gothic # Drop this because of the large filesize + packages = + (with pkgs; [ + ibm-plex + plemoljp-nf + inconsolata + mplus-outline-fonts.githubRelease + # sarasa-gothic # Drop this because of the large filesize - # emoji - noto-fonts-color-emoji - homemade-pkgs.beedii - twemoji-color-font + # emoji + noto-fonts-color-emoji + twemoji-color-font - # Source Han family includes many definitions, useful for fallback - source-han-code-jp - source-han-sans-japanese - source-han-serif-japanese - ]; + # Source Han family includes many definitions, useful for fallback + source-han-code-jp + source-han-sans-japanese + source-han-serif-japanese + ]) + ++ [ + # emoji + homemade-pkgs.beedii + ]; # Same as home-manager module? # https://github.com/nix-community/home-manager/issues/605 diff --git a/nixos/xremap.nix b/nixos/desktop/xremap.nix similarity index 100% rename from nixos/xremap.nix rename to nixos/desktop/xremap.nix diff --git a/nixos/gui.nix b/nixos/gui.nix deleted file mode 100644 index 55c2d8da..00000000 --- a/nixos/gui.nix +++ /dev/null @@ -1,92 +0,0 @@ -# Edit this configuration file to define what should be installed on -# your system. Help is available in the configuration.nix(5) man page -# and in the NixOS manual (accessible by running ‘nixos-help’). - -{ - pkgs, - edge-pkgs, - lib, - ... -}: -{ - services.xserver = { - enable = true; - - # Don't use other DM like SDDM, LightDM, lemurs for now. They don't start GNOME for now... (AFAIK) - # And when I was using KDE, GDM only worked, SDDM didn't work - # https://github.com/NixOS/nixpkgs/blob/nixos-24.05/nixos/modules/services/x11/display-managers/gdm.nix - displayManager.gdm.enable = true; - # https://github.com/NixOS/nixpkgs/blob/nixos-24.05/nixos/modules/services/x11/display-managers/lightdm.nix - # displayManager.lightdm.enable = false; - - desktopManager.gnome = { - enable = true; - # https://github.com/NixOS/nixpkgs/issues/114514 - extraGSettingsOverridePackages = [ pkgs.gnome.mutter ]; - }; - - # Configure keymap in X11 - xkb = { - layout = "us"; - variant = ""; - }; - }; - - services.udev.packages = with pkgs; [ gnome.gnome-settings-daemon ]; - - programs = { - # https://github.com/nix-community/home-manager/blob/release-24.05/modules/misc/dconf.nix#L39-L42 - dconf.enable = true; - # For lanching with command looks like better than alacritty - gnome-terminal.enable = true; - }; - - environment.gnome.excludePackages = - (with pkgs; [ - gnome-tour - gnome-connections - ]) - ++ (with pkgs.gnome; [ - epiphany # web browser - geary # email reader - evince # document viewer - gnome-calendar - gnome-music # does not support flac by defaults - ]); - - # Enable touchpad support (enabled default in most desktopManager). - services.libinput = { - enable = true; - mouse.naturalScrolling = true; - touchpad.naturalScrolling = true; - }; - - environment.systemPackages = with pkgs; [ - # gnome-music does not support flac. - # tramhao/termusic and tsirysndr/music-player does not figure how to use. - rhythmbox - ]; - - # Make it natural scroll on KDE, not enough only in libinput - # https://github.com/NixOS/nixpkgs/issues/51875#issuecomment-846251880 - # environment.etc."X11/xorg.conf.d/30-touchpad.conf".text = '' - # Section "InputClass" - # Identifier "libinput touchpad catchall" - # MatchIsTouchpad "on" - # MatchDevicePath "/dev/input/event*" - # Driver "libinput" - # Option "NaturalScrolling" "on" - # EndSection - # ''; - - # https://askubuntu.com/a/88947 - environment.etc."gdm/PostLogin/Default".source = lib.getExe ( - pkgs.writeShellApplication { - name = "connect_cloudflare-warp"; - runtimeInputs = with edge-pkgs; [ cloudflare-warp ]; - text = '' - warp-cli connect - ''; - } - ); -} diff --git a/nixos/hosts/algae/default.nix b/nixos/hosts/algae/default.nix index c2b6ad3f..e8345cf0 100644 --- a/nixos/hosts/algae/default.nix +++ b/nixos/hosts/algae/default.nix @@ -1,17 +1,14 @@ -{ inputs, ... }: +{ ... }: { networking.hostName = "algae"; imports = [ ../../configuration.nix - ../../gui.nix ../../hardware.nix + ../../desktop ./hardware-configuration.nix - - inputs.xremap-flake.nixosModules.default - ../../xremap.nix ]; # Apply better fonts for non X consoles diff --git a/nixos/hosts/moss/default.nix b/nixos/hosts/moss/default.nix index 11d8b3e9..156d2ff5 100644 --- a/nixos/hosts/moss/default.nix +++ b/nixos/hosts/moss/default.nix @@ -1,18 +1,15 @@ -{ inputs, ... }: +{ ... }: { networking.hostName = "moss"; imports = [ ../../configuration.nix - ../../gui.nix ../../hardware.nix + ../../desktop ./hardware-configuration.nix ./fingerprint.nix - - inputs.xremap-flake.nixosModules.default - ../../xremap.nix ]; # Apply better fonts for non X consoles diff --git a/nixos/language.nix b/nixos/language.nix deleted file mode 100644 index 7fe7b9c0..00000000 --- a/nixos/language.nix +++ /dev/null @@ -1,36 +0,0 @@ -# Edit this configuration file to define what should be installed on -# your system. Help is available in the configuration.nix(5) man page -# and in the NixOS manual (accessible by running ‘nixos-help’). - -{ config, pkgs, ... }: -{ - # Select internationalisation properties. - i18n = { - defaultLocale = "ja_JP.UTF-8"; - - extraLocaleSettings = { - LC_ADDRESS = "ja_JP.UTF-8"; - LC_IDENTIFICATION = "ja_JP.UTF-8"; - LC_MEASUREMENT = "ja_JP.UTF-8"; - LC_MONETARY = "ja_JP.UTF-8"; - LC_NAME = "ja_JP.UTF-8"; - LC_NUMERIC = "ja_JP.UTF-8"; - LC_PAPER = "ja_JP.UTF-8"; - LC_TELEPHONE = "ja_JP.UTF-8"; - LC_TIME = "ja_JP.UTF-8"; - }; - - inputMethod = { - enabled = "fcitx5"; - - fcitx5.addons = [ - pkgs.fcitx5-mozc - pkgs.fcitx5-gtk - ]; - - fcitx5.waylandFrontend = true; - }; - }; - - services.dbus.packages = [ config.i18n.inputMethod.package ]; -}