My Nix Infra
nix nixos
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

feat: nixos config & flakes

Jeff Yang 1767bb85 8d43867c

+664 -288
+25
Makefile
··· 1 + cp: 2 + bash scripts/cp-config.sh 3 + 4 + sw: 5 + sudo nixos-rebuild switch --flake . --impure 6 + 7 + setup: 8 + $(MAKE) sw 9 + $(MAKE) cp 10 + bash scripts/init-work.sh 11 + bash scripts/kde-config.sh 12 + reboot 13 + 14 + archsetup: 15 + bash scripts/archsetup.sh 16 + 17 + debug: 18 + sudo nixos-rebuild switch --flake . --show-trace --verbose 19 + 20 + gc: 21 + nix store gc --debug 22 + nix-collect-garbage --delete-old 23 + 24 + up: 25 + nix flake update
-59
abbr.fish
··· 1 - #!/usr/bin/env fish 2 - 3 - # directory navigation 4 - abbr -a .. "cd .." 5 - abbr -a ... "cd ../.." 6 - abbr -a .... "cd ../../.." 7 - abbr -a ..... "cd ../../../.." 8 - 9 - # some shortcuts 10 - abbr -a c "clear" 11 - abbr -a rem "rm -rf" 12 - 13 - # npm shortcuts 14 - abbr -a p "pnpm" 15 - 16 - # python shortcuts 17 - abbr -a py "python3" 18 - abbr -a pt "pytest" 19 - 20 - # rust shortcuts 21 - abbr -a co "cargo" 22 - 23 - # deno shortcuts 24 - abbr -a d "deno" 25 - 26 - # git shortcuts 27 - abbr -a gs "git status" 28 - abbr -a ga "git add" 29 - abbr -a gc "git commit -m" 30 - abbr -a gb "git branch" 31 - abbr -a gd "git diff" 32 - abbr -a gcl "git clone" 33 - abbr -a gco "git checkout" 34 - abbr -a gp "git push" 35 - abbr -a gl "git pull" 36 - abbr -a gt "git tag" 37 - abbr -a gm "git merge" 38 - abbr -a gf "git fetch" 39 - abbr -a gr "git rebase" 40 - abbr -a gg "git log --graph --pretty=format:\"%C(bold red)%h%Creset -%C(bold yellow)%d%Creset %s %C(bold green)(%cr) %C(bold blue)<%an>%Creset %C(yellow)%ad%Creset\" --abbrev-commit --date=short" 41 - abbr -a ggr "git log --reverse --pretty=format:\"%C(bold red)%h%Creset -%C(bold yellow)%d%Creset %s %C(bold green)(%cr) %C(bold blue)<%an>%Creset %C(yellow)%ad%Creset\" --abbrev-commit --date=short" 42 - 43 - # dotfiles 44 - abbr -a dot "cd $HOME/.dotfiles" 45 - abbr -a rl "source $FISH_CONFIG" 46 - 47 - # recursively delete .DS_Store 48 - abbr -a dds "find . -name \"*.DS_Store\" -type f -ls -delete" 49 - 50 - # recursively delete node_modules 51 - abbr -a nodemodules "find . -type d -name \"node_modules\" -exec rm -rf \"{}\" +" 52 - abbr -a pycache "find . -type d -name \"__pycache__\" -exec rm -rf \"{}\" +" 53 - 54 - # alias 55 - alias vim="nvim" 56 - 57 - # CC VPN 58 - alias ccvpnt="sudo openfortivpn ccvpn.it.cs.nycu.edu.tw:443 --realm test" 59 - alias ccvpnp="sudo openfortivpn ccvpn.it.cs.nycu.edu.tw:443 --realm prod"
-27
config.fish
··· 1 - set -gx EDITOR nvim 2 - set -gx BROWSER firefox 3 - set -gx DOTFILES_PATH $HOME/.dotfiles 4 - set -gx XDG_CONFIG_HOME $HOME/.config 5 - set -gx XDG_CACHE_HOME $HOME/.cache 6 - set -gx FISH_CONFIG $XDG_CONFIG_HOME/fish/config.fish 7 - set -gx PNPM_HOME $HOME/.local/share/pnpm 8 - set -gx TERM xterm-256color 9 - set -gx fish_color_command 00ff00 10 - set -gx fish_greeting 11 - 12 - fish_add_path $HOME/.composer/vendor/bin 13 - fish_add_path $PNPM_HOME 14 - fish_add_path $HOME/.local/bin 15 - fish_add_path $HOME/go/bin 16 - 17 - source (dirname (status --current-filename))/abbr.fish 18 - 19 - # mac or linux 20 - switch (uname) 21 - case Linux 22 - echo "> Linux profile $FISH_CONFIG loaded." 23 - case Darwin 24 - echo "> macOS profile $FISH_CONFIG loaded." 25 - end 26 - 27 - starship init fish | source
+20
config/.gitconfig
··· 1 + [color] 2 + ui = true 3 + [push] 4 + default = simple 5 + [fetch] 6 + prune = true 7 + [pull] 8 + rebase = true 9 + [user] 10 + name = ydcjeff 11 + email = n2ya@duck.com 12 + [core] 13 + editor = nvim 14 + [init] 15 + defaultBranch = main 16 + [includeIf "gitdir/i:/home/ydcjeff/cc/"] 17 + path = /home/ydcjeff/.config/git/gitconfig-cc 18 + [credential "https://gitlab.it.cs.nycu.edu.tw"] 19 + helper = 20 + helper = !/usr/bin/glab auth git-credential
+1
config/fish/abbr.fish
··· 53 53 54 54 # alias 55 55 alias vim="nvim" 56 + alias k="kubectl" 56 57 57 58 # CC VPN 58 59 alias ccvpnt="sudo openfortivpn ccvpn.it.cs.nycu.edu.tw:443 --realm test"
+16 -2
config/fish/config.fish
··· 9 9 set -gx fish_color_command 00ff00 10 10 set -gx fish_greeting 11 11 12 - fish_add_path $HOME/.composer/vendor/bin 12 + fish_add_path $HOME/.config/composer/vendor/bin 13 13 fish_add_path $PNPM_HOME 14 14 fish_add_path $HOME/.local/bin 15 15 fish_add_path $HOME/go/bin ··· 24 24 echo "> macOS profile $FISH_CONFIG loaded." 25 25 end 26 26 27 - starship init fish | source 27 + if type -q starship 28 + starship init fish | source 29 + end 30 + 31 + if type -q pnpm 32 + pnpm completion fish | source 33 + end 34 + 35 + if type -q uv 36 + uv generate-shell-completion fish | source 37 + end 38 + 39 + if type -q uvx 40 + uvx --generate-shell-completion fish | source 41 + end
+5 -2
containers/Containerfile-alpine-php
··· 11 11 fzf \ 12 12 curl \ 13 13 ca-certificates \ 14 + neovim \ 14 15 # php & its family 15 16 composer \ 16 17 icu-data-full \ ··· 48 49 php${PHP_VERSION}-intl \ 49 50 php${PHP_VERSION}-ldap \ 50 51 php${PHP_VERSION}-pecl-grpc \ 52 + php${PHP_VERSION}-pecl-xdebug \ 51 53 php${PHP_VERSION}-pecl-opentelemetry 52 54 55 + RUN sed -i 's/;zend_extension=xdebug.so/zend_extension=xdebug.so/;s/;xdebug.mode=off/xdebug.mode=coverage/' /etc/php${PHP_VERSION}/conf.d/50_xdebug.ini 53 56 ADD containers/csrootca.crt /usr/local/share/ca-certificates/ 54 57 RUN update-ca-certificates 55 58 ··· 63 66 64 67 RUN composer global require squizlabs/php_codesniffer laravel/pint 65 68 66 - COPY ./*.fish ./*.sh ./*.toml ./gitconfig* .dotfiles/ 67 - RUN .dotfiles/setup.sh && \ 69 + COPY . .dotfiles/ 70 + RUN bash .dotfiles/install/dotconfig.sh && \ 68 71 chown -R ${USER}:${USER} /home/${HOME_DIR}
+3 -3
containers/setup.sh
··· 12 12 USER_ID=$(id -u) 13 13 GID=$(id -g) 14 14 15 - command -v podman > /dev/null || (echo "podman not found" && exit 1) 16 - command -v toolbox > /dev/null || (echo "toolbox not found" && exit 1) 15 + command -v podman >/dev/null || (echo "podman not found" && exit 1) 16 + command -v toolbox >/dev/null || (echo "toolbox not found" && exit 1) 17 17 18 18 ##### cc www alpine backend PHP dev env 19 19 TAG=cc-www-alpine${ALPINE_VERSION//./}-php$PHP_VERSION ··· 27 27 podman build -f "$DIRNAME"/Containerfile-alpine-php \ 28 28 --build-arg ALPINE_VERSION="$ALPINE_VERSION" \ 29 29 --build-arg PHP_VERSION="$PHP_VERSION" \ 30 - --build-arg HOME_DIR="$TAG" \ 30 + --build-arg HOME_DIR="$USER" \ 31 31 --build-arg USER="$USER" \ 32 32 --build-arg UID="$USER_ID" \ 33 33 --build-arg GID="$GID" \
+24
flake.lock
··· 1 + { 2 + "nodes": { 3 + "nixpkgs": { 4 + "locked": { 5 + "lastModified": 1753373150, 6 + "narHash": "sha256-aeHPNoaqFEc+MkMYGzQurnlOoACpCaIA94cXt+z5qng=", 7 + "rev": "3ff0e34b1383648053bba8ed03f201d3466f90c9", 8 + "type": "tarball", 9 + "url": "https://releases.nixos.org/nixos/25.05/nixos-25.05.807027.3ff0e34b1383/nixexprs.tar.xz" 10 + }, 11 + "original": { 12 + "type": "tarball", 13 + "url": "https://channels.nixos.org/nixos-25.05/nixexprs.tar.xz" 14 + } 15 + }, 16 + "root": { 17 + "inputs": { 18 + "nixpkgs": "nixpkgs" 19 + } 20 + } 21 + }, 22 + "root": "root", 23 + "version": 7 24 + }
+55
flake.nix
··· 1 + { 2 + description = "nix, dotfiles, flake, ..."; 3 + 4 + inputs = { 5 + nixpkgs.url = "https://channels.nixos.org/nixos-25.05/nixexprs.tar.xz"; 6 + }; 7 + 8 + outputs = 9 + { nixpkgs, ... }@inputs: 10 + let 11 + lib = nixpkgs.lib; 12 + utils = import ./modules/utils.nix { inherit lib inputs; }; 13 + supportedSystems = [ 14 + "x86_64-linux" 15 + ]; 16 + forAllSystems = nixpkgs.lib.genAttrs supportedSystems; 17 + in 18 + { 19 + nixosConfigurations = { 20 + aspire5 = utils.mkSystem ./hosts/aspire.nix; 21 + }; 22 + 23 + formatter = forAllSystems (system: nixpkgs.legacyPackages.${system}.nixfmt-tree); 24 + 25 + devShells = forAllSystems ( 26 + system: 27 + let 28 + pkgs = nixpkgs.legacyPackages.${system}; 29 + phpEnv = pkgs.php83.buildEnv { 30 + extensions = ( 31 + { enabled, all }: 32 + enabled 33 + ++ (with all; [ 34 + xdebug 35 + ]) 36 + ); 37 + extraConfig = ''xdebug.mode=coverage''; 38 + }; 39 + in 40 + { 41 + default = pkgs.mkShell { 42 + packages = import ./modules/pkgs.nix { inherit pkgs; }; 43 + }; 44 + cc-www = pkgs.mkShell { 45 + name = "cc-www-dev"; 46 + packages = with pkgs; [ 47 + nodejs_24 48 + phpEnv 49 + phpEnv.packages.composer 50 + ]; 51 + }; 52 + } 53 + ); 54 + }; 55 + }
+17
hosts/aspire.nix
··· 1 + { pkgs, ... }: 2 + { 3 + imports = [ 4 + ../modules/nixos.nix 5 + ]; 6 + 7 + boot.loader.systemd-boot = { 8 + enable = true; 9 + configurationLimit = 10; 10 + consoleMode = "max"; 11 + }; 12 + 13 + networking.hostName = "aspire5"; 14 + 15 + # my custom options / configs 16 + my.desktop.enableKDE = true; 17 + }
-11
install/1-paru.sh
··· 1 - #!/usr/bin/env bash 2 - 3 - set -e 4 - 5 - if ! command -v paru &> /dev/null; then 6 - sudo pacman -S --needed base-devel git 7 - git clone https://aur.archlinux.org/paru-bin.git /tmp/paru 8 - cd /tmp/paru 9 - makepkg -si --noconfirm 10 - rm -rf /tmp/paru 11 - fi
-136
install/2-pkgs.sh
··· 1 - #!/usr/bin/env bash 2 - 3 - set -e 4 - 5 - has() { 6 - command -v "$1" &>/dev/null 7 - } 8 - 9 - pkgs=( 10 - # kde plasma ofc 11 - plasma 12 - dolphin 13 - ark 14 - gwenview 15 - mpv 16 - sddm 17 - kimageformats 18 - kwalletmanager 19 - power-profiles-daemon 20 - qt6-imageformats 21 - libappindicator-gtk3 22 - 23 - # arch related 24 - intel-ucode 25 - amd-ucode 26 - reflector 27 - archlinux-contrib 28 - pacman-contrib 29 - 30 - # common devtools 31 - bat 32 - coreutils 33 - fastfetch 34 - fd # find alternative 35 - fish 36 - fzf 37 - starship 38 - tree 39 - openssh 40 - openssl 41 - rsync 42 - just 43 - man 44 - man-db 45 - man-pages 46 - texinfo 47 - 48 - # network tools 49 - bind 50 - curl 51 - mtr 52 - wget 53 - tcpdump 54 - dhclient 55 - 56 - # process monitoring 57 - btop 58 - 59 - # vcs 60 - git 61 - github-cli 62 - glab 63 - 64 - # text processing 65 - jq 66 - 67 - # archive 68 - unzip 69 - zip 70 - 71 - # encryption and security 72 - age 73 - gnupg 74 - 75 - # terminal 76 - ghostty 77 - 78 - # editors 79 - nano 80 - neovim 81 - visual-studio-code-bin 82 - 83 - # browsers 84 - firefox 85 - brave-bin 86 - 87 - # vpn 88 - openfortivpn 89 - 90 - # fonts 91 - noto-fonts 92 - noto-fonts-cjk 93 - noto-fonts-emoji 94 - noto-fonts-extra 95 - ttf-jetbrains-mono 96 - ttf-font-awesome 97 - 98 - # containers 99 - docker 100 - podman 101 - toolbox 102 - 103 - # virtualization 104 - virtualbox 105 - 106 - # IME 107 - fcitx5-im 108 - fcitx5-rime 109 - 110 - discord 111 - telegram-desktop 112 - ) 113 - 114 - paru -Syu --noconfirm --needed ${pkgs[@]} 115 - 116 - # uv 117 - if ! has uv; then 118 - curl -LsSf https://astral.sh/uv/install.sh | sh 119 - fi 120 - 121 - # pnpm 122 - if ! has pnpm; then 123 - curl -fsSL https://get.pnpm.io/install.sh | sh 124 - fi 125 - 126 - # nix 127 - if ! has nix; then 128 - curl -L https://nixos.org/nix/install | sh -s -- --no-daemon 129 - fi 130 - 131 - sudo systemctl enable sddm 132 - sudo systemctl enable systemd-resolved.service 133 - sudo systemctl restart systemd-resolved.service 134 - sudo systemctl enable reflector.timer 135 - sudo systemctl restart reflector.timer 136 - sudo ln -sf /run/systemd/resolve/resolv.conf /etc/resolv.conf
-28
install/dotconfig.sh
··· 1 - #!/usr/bin/env bash 2 - 3 - set -e 4 - 5 - mkdir -p "$HOME"/.config 6 - cp -r "$HOME"/.dotfiles/config/* "$HOME"/.config 7 - 8 - # git defaults 9 - git config --global color.ui true 10 - git config --global push.default simple 11 - git config --global fetch.prune true 12 - git config --global pull.rebase true 13 - git config --global user.name "ydcjeff" 14 - git config --global user.email "n2ya@duck.com" 15 - git config --global core.editor "nvim" 16 - git config --global init.defaultBranch main 17 - git config --global includeIf.gitdir/i:"$HOME"/cc/.path "$HOME"/.config/git/gitconfig-cc 18 - 19 - # shell completions 20 - mkdir -p "$HOME"/.config/fish/completions 21 - echo 'pnpm completion fish | source' > "$HOME"/.config/fish/completions/pnpm.fish 22 - echo 'uv generate-shell-completion fish | source' > "$HOME"/.config/fish/completions/uv.fish 23 - echo 'uvx --generate-shell-completion fish | source' > "$HOME"/.config/fish/completions/uvx.fish 24 - 25 - # LazyVim 26 - if [[ ! -d "$HOME"/.config/nvim ]]; then 27 - git clone https://github.com/LazyVim/starter "$HOME"/.config/nvim 28 - fi
+1 -1
install/kde-config.sh scripts/kde-config.sh
··· 3 3 set -e 4 4 5 5 backup() { 6 - cp "$1" "$1"-$(date -Iseconds).bak 6 + cp "$1" "$1-$(date -Iseconds)".bak 7 7 } 8 8 9 9 kwc() {
install/mkdirs.sh scripts/init-work.sh
+34
modules/config.nix
··· 1 + { 2 + config, 3 + lib, 4 + pkgs, 5 + ... 6 + }: 7 + { 8 + options.my = { 9 + username = lib.mkOption { 10 + type = lib.types.str; 11 + default = "ydcjeff"; 12 + description = "username"; 13 + }; 14 + shell = lib.mkOption { 15 + type = lib.types.package; 16 + default = pkgs.fish; 17 + description = "default shell to use"; 18 + defaultText = lib.literalExpression "pkgs.fish"; 19 + }; 20 + desktop = { 21 + enableKDE = lib.mkEnableOption "enable KDE"; 22 + }; 23 + pkgs = { 24 + use = lib.mkOption { 25 + type = lib.types.enum [ 26 + "mini" 27 + "all" 28 + ]; 29 + default = "all"; 30 + description = "use minimal or all packages"; 31 + }; 32 + }; 33 + }; 34 + }
+37
modules/desktop.nix
··· 1 + { 2 + config, 3 + lib, 4 + pkgs, 5 + ... 6 + }@inputs: 7 + with inputs; 8 + let 9 + my = config.my; 10 + in 11 + { 12 + config = ( 13 + let 14 + kdeConfig = { 15 + services.desktopManager.plasma6 = { 16 + enable = true; 17 + }; 18 + 19 + environment.systemPackages = with pkgs; [ 20 + kdePackages.dolphin 21 + kdePackages.ark 22 + kdePackages.gwenview 23 + kdePackages.kwalletmanager 24 + ]; 25 + 26 + environment.plasma6.excludePackages = with pkgs; [ 27 + kdePackages.elisa 28 + kdePackages.kate 29 + kdePackages.okular 30 + ]; 31 + }; 32 + in 33 + lib.mkMerge [ 34 + (lib.mkIf my.desktop.enableKDE kdeConfig) 35 + ] 36 + ); 37 + }
+231
modules/nixos.nix
··· 1 + { 2 + config, 3 + pkgs, 4 + ... 5 + }@inputs: 6 + with inputs; 7 + let 8 + my = config.my; 9 + in 10 + { 11 + imports = [ 12 + ./config.nix 13 + ./desktop.nix 14 + ]; 15 + 16 + # Linux FHS 17 + # https://github.com/Mic92/nix-ld 18 + programs.nix-ld = { 19 + enable = true; 20 + }; 21 + 22 + # fonts 23 + fonts = { 24 + enableDefaultPackages = true; 25 + fontDir.enable = true; 26 + 27 + packages = with pkgs; [ 28 + font-awesome 29 + 30 + noto-fonts 31 + noto-fonts-cjk-serif 32 + noto-fonts-cjk-sans 33 + noto-fonts-color-emoji 34 + 35 + source-sans 36 + source-serif 37 + source-han-sans 38 + source-han-serif 39 + 40 + jetbrains-mono 41 + ]; 42 + 43 + fontconfig.defaultFonts = { 44 + serif = [ 45 + "Source Han Serif SC" 46 + "Source Han Serif TC" 47 + "Noto Color Emoji" 48 + ]; 49 + sansSerif = [ 50 + "Source Han Sans SC" 51 + "Source Han Sans TC" 52 + "Noto Color Emoji" 53 + ]; 54 + monospace = [ 55 + "JetBrainsMono" 56 + "Noto Color Emoji" 57 + ]; 58 + emoji = [ "Noto Color Emoji" ]; 59 + }; 60 + }; 61 + 62 + # gui apps 63 + environment.systemPackages = 64 + with pkgs; 65 + [ 66 + brave 67 + discord 68 + ghostty 69 + mpv 70 + sublime-merge 71 + telegram-desktop 72 + vscode 73 + # xdg 74 + xdg-utils 75 + xdg-user-dirs 76 + ] 77 + ++ import ./pkgs.nix { inherit pkgs; }; 78 + programs.firefox = { 79 + enable = true; 80 + preferences = { 81 + "apz.overscroll.enabled" = false; 82 + }; 83 + }; 84 + programs.chromium = { 85 + enable = true; 86 + extensions = [ 87 + "ophjlpahpchlmihnnnihgmmeilfjmjjc" # LINE 88 + "nhdogjmejiglipccpnnnanhbledajbpd" # Vue devtools 89 + ]; 90 + }; 91 + 92 + # locale 93 + time.timeZone = "Asia/Taipei"; 94 + i18n.inputMethod = { 95 + enable = true; 96 + type = "fcitx5"; 97 + fcitx5.addons = with pkgs; [ 98 + fcitx5-rime 99 + fcitx5-gtk 100 + ]; 101 + }; 102 + i18n.defaultLocale = "en_US.UTF-8"; 103 + i18n.extraLocaleSettings = { 104 + LC_ADDRESS = "en_US.UTF-8"; 105 + LC_IDENTIFICATION = "en_US.UTF-8"; 106 + LC_MEASUREMENT = "en_US.UTF-8"; 107 + LC_MONETARY = "en_US.UTF-8"; 108 + LC_NAME = "en_US.UTF-8"; 109 + LC_NUMERIC = "en_US.UTF-8"; 110 + LC_PAPER = "en_US.UTF-8"; 111 + LC_TELEPHONE = "en_US.UTF-8"; 112 + LC_TIME = "ja_JP.UTF-8"; 113 + }; 114 + 115 + # nix settings 116 + nixpkgs.config.allowUnfree = true; 117 + nix = { 118 + settings = { 119 + experimental-features = "nix-command flakes"; 120 + auto-optimise-store = true; 121 + }; 122 + gc = { 123 + automatic = true; 124 + options = "--delete-older-than 7d"; 125 + dates = "weekly"; 126 + }; 127 + channel.enable = true; 128 + }; 129 + 130 + # virtualisation 131 + virtualisation.podman = { 132 + enable = true; 133 + dockerCompat = false; 134 + autoPrune = { 135 + enable = false; 136 + dates = "weekly"; 137 + }; 138 + }; 139 + virtualisation.docker = { 140 + enable = false; 141 + autoPrune = { 142 + enable = false; 143 + dates = "weekly"; 144 + }; 145 + }; 146 + virtualisation.virtualbox = { 147 + host = { 148 + enable = false; 149 + }; 150 + }; 151 + 152 + # users 153 + programs.fish.enable = true; 154 + users = { 155 + mutableUsers = true; 156 + groups.${my.username} = { }; 157 + users.${my.username} = { 158 + home = "/home/${my.username}"; 159 + name = "${my.username}"; 160 + description = "${my.username}"; 161 + isNormalUser = true; 162 + shell = my.shell; 163 + extraGroups = [ 164 + "${my.username}" 165 + "networkmanager" 166 + "wheel" 167 + ]; 168 + }; 169 + }; 170 + 171 + # xdg 172 + xdg.mime = { 173 + enable = true; 174 + defaultApplications = 175 + let 176 + browser = [ "firefox.desktop" ]; 177 + editors = [ 178 + "nvim.desktop" 179 + "code.desktop" 180 + ]; 181 + in 182 + { 183 + "application/json" = browser; 184 + "application/pdf" = browser; 185 + }; 186 + }; 187 + 188 + services.power-profiles-daemon.enable = true; 189 + 190 + services.displayManager.sddm = { 191 + enable = true; 192 + wayland.enable = true; 193 + }; 194 + 195 + services.xserver = { 196 + enable = false; 197 + }; 198 + 199 + services.printing.enable = false; 200 + 201 + # Enable sound with pipewire. 202 + security.rtkit.enable = true; 203 + services.pulseaudio.enable = false; 204 + services.pipewire = { 205 + enable = true; 206 + alsa.enable = true; 207 + alsa.support32Bit = true; 208 + pulse.enable = true; 209 + # If you want to use JACK applications, uncomment this 210 + # jack.enable = true; 211 + 212 + # use the example session manager (no others are packaged yet so this is enabled by default, 213 + # no need to redefine it in your config for now) 214 + # media-session.enable = true; 215 + }; 216 + 217 + # Fuse filesystem that returns symlinks to executables based on the PATH of 218 + # the requesting process. This is useful to execute shebangs on NixOS that 219 + # assume hard coded locations in locations like /bin or /usr/bin etc. 220 + services.envfs.enable = true; 221 + 222 + # Bluetooth 223 + hardware.bluetooth.enable = true; 224 + 225 + networking = { 226 + networkmanager.enable = true; 227 + }; 228 + 229 + # https://discourse.nixos.org/t/slow-build-at-building-man-cache/52365/3 230 + documentation.man.generateCaches = false; 231 + }
+69
modules/pkgs.nix
··· 1 + { 2 + pkgs, 3 + ... 4 + }: 5 + with pkgs; 6 + [ 7 + # common QoL devtools 8 + bat 9 + coreutils 10 + fastfetch 11 + fd # find alternative 12 + fish 13 + starship 14 + fzf 15 + gnumake 16 + tree 17 + neovim 18 + openssh 19 + openssl 20 + rsync 21 + # just 22 + man 23 + man-pages 24 + texinfo 25 + zoxide 26 + shellcheck 27 + 28 + # network tools 29 + dnsutils 30 + curl 31 + mtr 32 + wget 33 + tcpdump 34 + traceroute 35 + 36 + # process monitoring 37 + btop 38 + 39 + # vcs 40 + git 41 + github-cli 42 + glab 43 + 44 + # text processing 45 + jq 46 + 47 + # archive 48 + unzip 49 + zip 50 + gnutar 51 + 52 + # encryption and security 53 + # age 54 + gnupg 55 + 56 + # vpn 57 + openfortivpn 58 + 59 + # containers 60 + podman-tui 61 + toolbox 62 + distrobox 63 + 64 + # nix 65 + nixfmt-tree 66 + 67 + pnpm 68 + uv 69 + ]
+19
modules/utils.nix
··· 1 + { lib, inputs, ... }: 2 + with inputs; 3 + let 4 + osRelease = builtins.tryEval (builtins.readFile "/etc/os-release"); 5 + isNixOS = osRelease.success && builtins.match ".*ID=nixos.*" osRelease.value != null; 6 + in 7 + { 8 + inherit isNixOS; 9 + 10 + mkSystem = 11 + config: 12 + lib.nixosSystem { 13 + specialArgs = { inherit inputs; }; 14 + modules = [ 15 + /etc/nixos/configuration.nix 16 + config 17 + ]; 18 + }; 19 + }
+97
scripts/archsetup.sh
··· 1 + #!/usr/bin/env bash 2 + 3 + set -e 4 + 5 + SCRIPT_DIR=$(dirname "$(realpath "$0")") 6 + 7 + if ! command -v paru &> /dev/null; then 8 + sudo pacman -S --needed base-devel git 9 + git clone https://aur.archlinux.org/paru-bin.git /tmp/paru 10 + cd /tmp/paru 11 + makepkg -si --noconfirm 12 + rm -rf /tmp/paru 13 + fi 14 + 15 + has() { 16 + command -v "$1" &>/dev/null 17 + } 18 + 19 + pkgs=( 20 + # kde plasma ofc 21 + plasma 22 + dolphin 23 + ark 24 + gwenview 25 + mpv 26 + sddm 27 + kimageformats 28 + kwalletmanager 29 + power-profiles-daemon 30 + qt6-imageformats 31 + libappindicator-gtk3 32 + 33 + # arch related 34 + intel-ucode 35 + amd-ucode 36 + reflector 37 + archlinux-contrib 38 + pacman-contrib 39 + 40 + # terminal 41 + ghostty 42 + 43 + # editors 44 + visual-studio-code-bin 45 + 46 + # browsers 47 + firefox 48 + brave-bin 49 + 50 + # fonts 51 + noto-fonts 52 + noto-fonts-cjk 53 + noto-fonts-emoji 54 + noto-fonts-extra 55 + ttf-jetbrains-mono 56 + ttf-font-awesome 57 + 58 + # virtualization 59 + virtualbox 60 + virtualbox-guest-iso 61 + virtualbox-host-dkms 62 + virtualbox-host-modules-lts 63 + 64 + # IME 65 + fcitx5-im 66 + fcitx5-rime 67 + 68 + discord 69 + telegram-desktop 70 + ) 71 + 72 + paru -Syu --noconfirm --needed "${pkgs[@]}" 73 + 74 + # nix 75 + if ! has nix; then 76 + curl -L https://nixos.org/nix/install | sh -s -- --no-daemon 77 + fi 78 + 79 + sudo systemctl enable sddm 80 + sudo systemctl enable systemd-resolved.service 81 + sudo systemctl restart systemd-resolved.service 82 + sudo systemctl enable bluetooth.service 83 + sudo systemctl restart bluetooth.service 84 + sudo systemctl enable reflector.timer 85 + sudo systemctl restart reflector.timer 86 + sudo ln -sf /run/systemd/resolve/stub-resolv.conf /etc/resolv.conf 87 + 88 + bash "$SCRIPT_DIR/cp-config.sh" 89 + bash "$SCRIPT_DIR/init-work.sh" 90 + bash "$SCRIPT_DIR/kde-config.sh" 91 + 92 + chsh -s "$(which fish)" 93 + 94 + read -rp "reboot? (y/n): " reply 95 + if [[ $reply = "y" ]]; then 96 + reboot 97 + fi
+10
scripts/cp-config.sh
··· 1 + #!/usr/bin/env bash 2 + 3 + set -e 4 + 5 + mkdir -p "$HOME"/.config 6 + cp -r "$HOME"/.dotfiles/config/* "$HOME"/.config 7 + # LazyVim 8 + if [[ ! -d "$HOME"/.config/nvim ]]; then 9 + git clone https://github.com/LazyVim/starter "$HOME"/.config/nvim 10 + fi
-19
setup.sh
··· 1 - #!/usr/bin/env bash 2 - 3 - set -e 4 - 5 - # clone dotfiles 6 - if [[ -d "$HOME"/.dotfiles ]]; then 7 - echo "> .dotfiles dir exist, not cloning" 8 - else 9 - git clone https://gitlab.com/ydcjeff/dotfiles "$HOME"/.dotfiles 10 - fi 11 - 12 - for f in "$HOME"/.dotfiles/install/*.sh; do source "$f"; done 13 - 14 - chsh -s $(which fish) 15 - 16 - read -p "reboot? (y/n): " reply 17 - if [[ $reply = "y" ]]; then 18 - reboot 19 - fi