From 02ded93d14e80d618f05a40ade2f78c199baa780 Mon Sep 17 00:00:00 2001 From: Kenryu Shibata Date: Thu, 29 Aug 2024 18:54:36 +0900 Subject: [PATCH] Update ~8/26/24 --- machines/workstation/configuration.nix | 4 ++++ machines/workstation/home.nix | 7 +++++++ newpkg.sh | 2 +- system/env.nix | 7 +++++++ system/hardware/inputMethods.nix | 13 +++++++++++++ system/hardware/nvidia.nix | 1 + system/services/docker.nix | 9 +++++++-- system/utils.nix | 1 + user/.profile | 3 +++ user/apps/browsers/firefox.nix | 2 +- user/apps/graphics/gimp.nix | 6 ++++++ user/apps/graphics/inkscape.nix | 6 ++++++ user/apps/office/texlive.nix | 20 ++++++++++++++++++++ user/apps/thunderbird.nix | 6 ++++++ user/dev/lang/cc.nix | 1 + user/dev/lang/ecmascript.nix | 6 ++++++ user/dev/tools/firefox-devedition.nix | 6 ++++++ user/profile.nix | 4 ++++ user/shell/bash.nix | 20 ++++++++++++++++++++ 19 files changed, 120 insertions(+), 4 deletions(-) create mode 100644 system/env.nix create mode 100644 system/hardware/inputMethods.nix create mode 100644 user/.profile create mode 100644 user/apps/graphics/gimp.nix create mode 100644 user/apps/graphics/inkscape.nix create mode 100644 user/apps/office/texlive.nix create mode 100644 user/apps/thunderbird.nix create mode 100644 user/dev/lang/ecmascript.nix create mode 100644 user/dev/tools/firefox-devedition.nix create mode 100644 user/profile.nix create mode 100644 user/shell/bash.nix diff --git a/machines/workstation/configuration.nix b/machines/workstation/configuration.nix index 6b734fd..5210cbb 100644 --- a/machines/workstation/configuration.nix +++ b/machines/workstation/configuration.nix @@ -18,12 +18,16 @@ ../../system/hardware/opengl.nix ../../system/hardware/bluetooth.nix ../../system/wm/sddm.nix + ../../system/hardware/inputMethods.nix + ../../system/env.nix ]; # Use the systemd-boot EFI boot loader. boot.loader.systemd-boot.enable = true; boot.loader.efi.canTouchEfiVariables = true; + systemd.enableUnifiedCgroupHierarchy = false; + programs.appimage = { enable = true; binfmt = true; diff --git a/machines/workstation/home.nix b/machines/workstation/home.nix index 96e0e6d..131c863 100644 --- a/machines/workstation/home.nix +++ b/machines/workstation/home.nix @@ -2,13 +2,16 @@ { imports = [ ../../user/apps/browsers/firefox.nix + ../../user/apps/thunderbird.nix ../../user/dev/tools/git.nix ../../user/dev/tools/gitui.nix + ../../user/dev/tools/firefox-devedition.nix ../../user/dev/editor/vscodium.nix ../../user/dev/editor/zed-editor.nix ../../user/dev/lang/cc.nix ../../user/dev/lang/python.nix ../../user/dev/lang/rust.nix + ../../user/dev/lang/ecmascript.nix ../../user/dev/ide/qtcreator.nix ../../user/apps/utils/alacritty.nix ../../user/apps/utils/keepassxc.nix @@ -19,7 +22,11 @@ ../../user/apps/media/vlc.nix ../../user/apps/media/mpv.nix ../../user/apps/media/yt-dlp.nix + ../../user/apps/graphics/gimp.nix + ../../user/apps/graphics/inkscape.nix ../../user/apps/games/mangohud.nix + ../../user/apps/office/texlive.nix + ../../user/shell/bash.nix ../../user/wm/xmonad/xmonad.nix ]; diff --git a/newpkg.sh b/newpkg.sh index c5db416..b6b87dd 100644 --- a/newpkg.sh +++ b/newpkg.sh @@ -1,6 +1,6 @@ #!/bin/bash -echo "newpkg.sh: create minimal nix file in current directory" +echo "newpkg.sh: create minimal nix file in current directory, Current Directory: $PWD" if [ -z "$NIXOSSYSCONFIG" ]; then echo "Error: Env Variable Missing, NIXOSSYSCONFIG" diff --git a/system/env.nix b/system/env.nix new file mode 100644 index 0000000..72c9fb0 --- /dev/null +++ b/system/env.nix @@ -0,0 +1,7 @@ +{ config, lib, pkgs, ... }: +{ + environment.variables = { + EDITOR = "vim"; + MOZ_ENABLE_WAYLAND = 1; + }; +} diff --git a/system/hardware/inputMethods.nix b/system/hardware/inputMethods.nix new file mode 100644 index 0000000..51c9470 --- /dev/null +++ b/system/hardware/inputMethods.nix @@ -0,0 +1,13 @@ +{ config, lib, pkgs, systemSettings, ... }: +{ + i18n = { + inputMethod = { + enabled = "fcitx5"; + fcitx5 = { + waylandFrontend = true; + plasma6Support = true; + addons = with pkgs; [ fcitx5-mozc ]; + }; + }; + }; +} diff --git a/system/hardware/nvidia.nix b/system/hardware/nvidia.nix index 723f556..015dfb2 100644 --- a/system/hardware/nvidia.nix +++ b/system/hardware/nvidia.nix @@ -8,5 +8,6 @@ powerManagement.finegrained = false; open = true; nvidiaSettings = true; + package = config.boot.kernelPackages.nvidiaPackages.production; }; } diff --git a/system/services/docker.nix b/system/services/docker.nix index ee56420..0c5ae6a 100644 --- a/system/services/docker.nix +++ b/system/services/docker.nix @@ -1,9 +1,14 @@ -{ pkgs, config, ... }: +{ pkgs, config, lib, ... }: { + virtualisation.containers.enable = true; + virtualisation.docker = { enable = true; storageDriver = "overlay2"; enableOnBoot = true; + daemon.settings = { + features.cdi = true; + }; }; environment.systemPackages = with pkgs; [ @@ -13,5 +18,5 @@ nvidia-container-toolkit ]; - hardware.nvidia-container-toolkit.enable = true; + hardware.nvidia-container-toolkit.enable = lib.lists.elem "nvidia" config.services.xserver.videoDrivers; } diff --git a/system/utils.nix b/system/utils.nix index 1ae8013..45fa686 100644 --- a/system/utils.nix +++ b/system/utils.nix @@ -5,6 +5,7 @@ vim wget file + eza jq htop mc diff --git a/user/.profile b/user/.profile new file mode 100644 index 0000000..69435f6 --- /dev/null +++ b/user/.profile @@ -0,0 +1,3 @@ +export XDG_DATA_DIRS=$XDG_DATA_DIRS:/usr/share:/var/lib/flatpak/exports/share:$HOME/.local/share/flatpak/exports/share + +export PATH="$PATH:${XDG_BIN_HOME:-$HOME/.local/bin}" diff --git a/user/apps/browsers/firefox.nix b/user/apps/browsers/firefox.nix index d5afc97..0674f5f 100644 --- a/user/apps/browsers/firefox.nix +++ b/user/apps/browsers/firefox.nix @@ -1,4 +1,4 @@ -{ pkgs, config, ... }: +{ pkgs, config, ... }: { home.packages = [ pkgs.firefox ]; } diff --git a/user/apps/graphics/gimp.nix b/user/apps/graphics/gimp.nix new file mode 100644 index 0000000..62b832a --- /dev/null +++ b/user/apps/graphics/gimp.nix @@ -0,0 +1,6 @@ +{ pkgs, ... }: +{ + home.packages = with pkgs; [ + gimp + ]; +} diff --git a/user/apps/graphics/inkscape.nix b/user/apps/graphics/inkscape.nix new file mode 100644 index 0000000..ebfac2b --- /dev/null +++ b/user/apps/graphics/inkscape.nix @@ -0,0 +1,6 @@ +{ pkgs, ... }: +{ + home.packages = with pkgs; [ + inkscape + ]; +} diff --git a/user/apps/office/texlive.nix b/user/apps/office/texlive.nix new file mode 100644 index 0000000..8c08d65 --- /dev/null +++ b/user/apps/office/texlive.nix @@ -0,0 +1,20 @@ +{ pkgs, ... }: +let + mytex = pkgs.texliveMedium.withPackages + (ps: [ + ps.biber + ps.biblatex + ps.bibtex + ps.import + ps.subfiles + ps.wrapfig + ps.collection-langjapanese + ]); +in +{ + home.packages = with pkgs; [ + mytex + pandoc + qpdf + ]; +} diff --git a/user/apps/thunderbird.nix b/user/apps/thunderbird.nix new file mode 100644 index 0000000..4b202ab --- /dev/null +++ b/user/apps/thunderbird.nix @@ -0,0 +1,6 @@ +{ pkgs, ... }: +{ + home.packages = with pkgs; [ + thunderbird + ]; +} diff --git a/user/dev/lang/cc.nix b/user/dev/lang/cc.nix index 18b1178..ad072b3 100644 --- a/user/dev/lang/cc.nix +++ b/user/dev/lang/cc.nix @@ -6,6 +6,7 @@ cmake autoconf automake + gnumake libtool clang-analyzer clang-tools diff --git a/user/dev/lang/ecmascript.nix b/user/dev/lang/ecmascript.nix new file mode 100644 index 0000000..54e1d04 --- /dev/null +++ b/user/dev/lang/ecmascript.nix @@ -0,0 +1,6 @@ +{ pkgs, ... }: +{ + home.packages = with pkgs; [ + nodejs_20 + ]; +} diff --git a/user/dev/tools/firefox-devedition.nix b/user/dev/tools/firefox-devedition.nix new file mode 100644 index 0000000..746c146 --- /dev/null +++ b/user/dev/tools/firefox-devedition.nix @@ -0,0 +1,6 @@ +{ pkgs, ... }: +{ + home.packages = with pkgs; [ + firefox-devedition-bin + ]; +} diff --git a/user/profile.nix b/user/profile.nix new file mode 100644 index 0000000..cf42340 --- /dev/null +++ b/user/profile.nix @@ -0,0 +1,4 @@ +{ config, ... }: +{ + home.file.".profile".source = ./.profile; +} diff --git a/user/shell/bash.nix b/user/shell/bash.nix new file mode 100644 index 0000000..af8754f --- /dev/null +++ b/user/shell/bash.nix @@ -0,0 +1,20 @@ +{ config, pkgs, ... }: +let + lsCmd = "eza -la --git -s type"; +in +{ + home.packages = with pkgs; [ + bash + ]; + + programs.bash = { + enable = true; + shellAliases = { + search-pkg = "nix search -I nixpkgs=flake:nixpkgs nixpkgs"; + newpkg = "bash ~/.dotfiles/newpkg.sh"; + rebuild = "sudo nixos-rebuild switch --flake '.#system'"; + l = lsCmd; + ls = lsCmd; + }; + }; +}