From c6a31bb751b15cd8acd31d53cbe449d665fce2ab Mon Sep 17 00:00:00 2001 From: cswimr Date: Mon, 2 Dec 2024 19:57:19 -0500 Subject: [PATCH] switch to the rfc nixfmt version and reformatted repository --- flake.nix | 18 +- home-manager/user.nix | 54 +++--- home-manager/vscode.nix | 182 ++++++++++++--------- hosts/eclipse.nix | 61 ++++--- hosts/nebula.nix | 29 +++- hosts/virtual-machines/gnome/default.nix | 3 +- hosts/virtual-machines/nixpkgs/default.nix | 3 +- nixos/catppuccin.nix | 17 +- nixos/configuration.nix | 16 +- nixos/development.nix | 3 +- nixos/environment.nix | 3 +- nixos/flatpak.nix | 15 +- nixos/gaming.nix | 3 +- nixos/git.nix | 8 +- nixos/gui-pkgs.nix | 17 +- nixos/nvidia.nix | 7 +- nixos/nvim.nix | 3 +- nixos/pkg.nix | 17 +- nixos/shell.nix | 178 ++++++++++---------- nixos/sudo.nix | 21 ++- nixos/tailscale.nix | 7 +- scripts/nix/python.nix | 3 +- 22 files changed, 402 insertions(+), 266 deletions(-) diff --git a/flake.nix b/flake.nix index 805e932..12a1957 100644 --- a/flake.nix +++ b/flake.nix @@ -24,7 +24,8 @@ nix-vscode-extensions.url = "github:nix-community/nix-vscode-extensions"; catppuccin-vsc.url = "https://flakehub.com/f/catppuccin/vscode/*.tar.gz"; }; - outputs = { nixpkgs, home-manager, ... }@inputs: + outputs = + { nixpkgs, home-manager, ... }@inputs: let user = "cswimr"; system = "x86_64-linux"; @@ -33,7 +34,8 @@ overlays = [ inputs.catppuccin-vsc.overlays.default ]; config.allowUnfree = true; }; - in { + in + { nixosConfigurations = { eclipse = nixpkgs.lib.nixosSystem { system = system; @@ -76,8 +78,7 @@ home-manager = { useGlobalPkgs = true; useUserPackages = true; - sharedModules = - [ inputs.plasma-manager.homeManagerModules.plasma-manager ]; + sharedModules = [ inputs.plasma-manager.homeManagerModules.plasma-manager ]; backupFileExtension = "bak"; extraSpecialArgs = { inherit inputs; @@ -92,8 +93,7 @@ ./home-manager/user.nix ./home-manager/vscode.nix { - programs.git.extraConfig.user.signingkey = - "0EC431A8DA8F8087"; + programs.git.extraConfig.user.signingkey = "0EC431A8DA8F8087"; } ]; }; @@ -141,8 +141,7 @@ home-manager = { useGlobalPkgs = true; useUserPackages = true; - sharedModules = - [ inputs.plasma-manager.homeManagerModules.plasma-manager ]; + sharedModules = [ inputs.plasma-manager.homeManagerModules.plasma-manager ]; backupFileExtension = "bak"; extraSpecialArgs = { inherit inputs; @@ -157,8 +156,7 @@ ./home-manager/user.nix ./home-manager/vscode.nix { - programs.git.extraConfig.user.signingkey = - "082F226A1D8C0860"; + programs.git.extraConfig.user.signingkey = "082F226A1D8C0860"; } ]; }; diff --git a/home-manager/user.nix b/home-manager/user.nix index 2be1ee1..06c6601 100755 --- a/home-manager/user.nix +++ b/home-manager/user.nix @@ -1,22 +1,21 @@ -{ pkgs, config, user, ... }: { +{ + pkgs, + config, + user, + ... +}: +{ home.username = user; home.homeDirectory = "/home/${user}"; home.file = { - ".face.icon".source = - config.lib.file.mkOutOfStoreSymlink "/etc/nixos/assets/img/clownfish.png"; - ".config/fastfetch/config.jsonc".source = - config.lib.file.mkOutOfStoreSymlink "/etc/nixos/config/fastfetch.jsonc"; - ".psqlrc".source = - config.lib.file.mkOutOfStoreSymlink "/etc/nixos/config/.psqlrc"; - ".config/btop/btop.conf".source = - config.lib.file.mkOutOfStoreSymlink "/etc/nixos/config/btop.conf"; - ".config/btop/themes/catppuccin_mocha.theme".source = - config.lib.file.mkOutOfStoreSymlink "/etc/nixos/config/themes/btop.theme"; - ".config/glow/glow.yml".source = - config.lib.file.mkOutOfStoreSymlink "/etc/nixos/config/glow.yml"; - ".config/glow/theme.json".source = - config.lib.file.mkOutOfStoreSymlink "/etc/nixos/config/themes/glow.json"; + ".face.icon".source = config.lib.file.mkOutOfStoreSymlink "/etc/nixos/assets/img/clownfish.png"; + ".config/fastfetch/config.jsonc".source = config.lib.file.mkOutOfStoreSymlink "/etc/nixos/config/fastfetch.jsonc"; + ".psqlrc".source = config.lib.file.mkOutOfStoreSymlink "/etc/nixos/config/.psqlrc"; + ".config/btop/btop.conf".source = config.lib.file.mkOutOfStoreSymlink "/etc/nixos/config/btop.conf"; + ".config/btop/themes/catppuccin_mocha.theme".source = config.lib.file.mkOutOfStoreSymlink "/etc/nixos/config/themes/btop.theme"; + ".config/glow/glow.yml".source = config.lib.file.mkOutOfStoreSymlink "/etc/nixos/config/glow.yml"; + ".config/glow/theme.json".source = config.lib.file.mkOutOfStoreSymlink "/etc/nixos/config/themes/glow.json"; }; # link the configuration file in current directory to the specified location in home directory @@ -49,19 +48,32 @@ userName = user; userEmail = "seaswimmerthefsh@gmail.com"; extraConfig = { - commit = { gpgsign = true; }; + commit = { + gpgsign = true; + }; signing = { signByDefault = true; }; - init = { defaultBranch = "master"; }; - safe = { directory = "/etc/nixos"; }; + init = { + defaultBranch = "master"; + }; + safe = { + directory = "/etc/nixos"; + }; url = { "git@coastalcommits.com:" = { - insteadOf = - [ "https://www.coastalcommits.com/" "cc:" "coastalcommits:" ]; + insteadOf = [ + "https://www.coastalcommits.com/" + "cc:" + "coastalcommits:" + ]; }; "git@github.com:" = { - insteadOf = [ "https://github.com/" "gh:" "github:" ]; + insteadOf = [ + "https://github.com/" + "gh:" + "github:" + ]; }; }; hub.protocol = "ssh"; diff --git a/home-manager/vscode.nix b/home-manager/vscode.nix index 752e465..887ba9c 100644 --- a/home-manager/vscode.nix +++ b/home-manager/vscode.nix @@ -1,39 +1,64 @@ -{ pkgs, config, system, inputs, ... }: rec { +{ + pkgs, + config, + system, + inputs, + ... +}: +rec { # Make VSCode config writable # https://github.com/nix-community/home-manager/issues/1800#issuecomment-2262881846 - home.activation.makeVSCodeConfigWritable = let - configDirName = { - "vscode" = "Code"; - "vscode-insiders" = "Code - Insiders"; - "vscodium" = "VSCodium"; - }.${programs.vscode.package.pname}; - configPath = "${config.xdg.configHome}/${configDirName}/User/settings.json"; - in { - after = [ "writeBoundary" ]; - before = [ ]; - data = '' - install -m 0640 "$(readlink ${configPath})" ${configPath} - ''; - }; + home.activation.makeVSCodeConfigWritable = + let + configDirName = + { + "vscode" = "Code"; + "vscode-insiders" = "Code - Insiders"; + "vscodium" = "VSCodium"; + } + .${programs.vscode.package.pname}; + configPath = "${config.xdg.configHome}/${configDirName}/User/settings.json"; + in + { + after = [ "writeBoundary" ]; + before = [ ]; + data = '' + install -m 0640 "$(readlink ${configPath})" ${configPath} + ''; + }; programs.vscode = { enable = true; - package = pkgs.vscode.fhsWithPackages - (ps: with pkgs; [ dotnetCorePackages.sdk_8_0 jdk21 go ]); + package = pkgs.vscode.fhsWithPackages ( + ps: with pkgs; [ + dotnetCorePackages.sdk_8_0 + jdk21 + go + ] + ); extensions = with inputs.nix-vscode-extensions.extensions.${system}.vscode-marketplace; - with inputs.nix-vscode-extensions.extensions.${system}.vscode-marketplace-release; [ + with inputs.nix-vscode-extensions.extensions.${system}.vscode-marketplace-release; + [ # Themes (pkgs.catppuccin-vsc.override { accent = "blue"; extraBordersEnabled = true; italicKeywords = false; customUIColors = { - mocha = { "statusBar.foreground" = "accent"; }; - macchiato = { "statusBar.foreground" = "accent"; }; - frappe = { "statusBar.foreground" = "accent"; }; - latte = { "statusBar.foreground" = "accent"; }; + mocha = { + "statusBar.foreground" = "accent"; + }; + macchiato = { + "statusBar.foreground" = "accent"; + }; + frappe = { + "statusBar.foreground" = "accent"; + }; + latte = { + "statusBar.foreground" = "accent"; + }; }; }) catppuccin.catppuccin-vsc-icons @@ -185,15 +210,21 @@ } { "scope" = "variable.other.readwrite"; - "settings" = { "foreground" = "#82eaf0"; }; + "settings" = { + "foreground" = "#82eaf0"; + }; } { "scope" = "keyword.operator"; - "settings" = { "foreground" = "#EBA0AC"; }; + "settings" = { + "foreground" = "#EBA0AC"; + }; } { "scope" = "meta.block.paradox"; - "settings" = { "foreground" = "#EBA0AC"; }; + "settings" = { + "foreground" = "#EBA0AC"; + }; } { "scope" = "meta.shebang.shell"; @@ -210,13 +241,16 @@ }; } { - "scope" = - "string.quoted.double.shell variable.other.normal.shell"; - "settings" = { "foreground" = "#82e5f0"; }; + "scope" = "string.quoted.double.shell variable.other.normal.shell"; + "settings" = { + "foreground" = "#82e5f0"; + }; } { "scope" = "variable.other.property.ts"; - "settings" = { "foreground" = "#32d5e7"; }; + "settings" = { + "foreground" = "#32d5e7"; + }; } ]; }; @@ -245,7 +279,9 @@ "editor.formatOnSaveMode" = "file"; "files.autoSave" = "onFocusChange"; }; - "[markdown]" = { "files.trimTrailingWhitespace" = false; }; + "[markdown]" = { + "files.trimTrailingWhitespace" = false; + }; "yaml.schemas" = { "https://json.schemastore.org/github-workflow.json" = [ ".github/workflows/*.{yml,yaml}" @@ -256,29 +292,23 @@ "yaml.schemaStore.enable" = true; "nix.enableLanguageServer" = true; "nix.serverSettings" = { - "nil" = { "formatting" = { "command" = [ "nixfmt" ]; }; }; + "nil" = { + "formatting" = { + "command" = [ "nixfmt" ]; + }; + }; }; "nix.serverPath" = "nil"; - "vscord.status.image.large.debugging.key" = - "https://vscord.catppuccin.com/mocha/debugging.webp"; - "vscord.status.image.large.editing.key" = - "https://vscord.catppuccin.com/mocha/{lang}.webp"; - "vscord.status.image.large.idle.key" = - "https://vscord.catppuccin.com/mocha/idle-{app_id}.webp"; - "vscord.status.image.large.notInFile.key" = - "https://vscord.catppuccin.com/mocha/idle-{app_id}.webp"; - "vscord.status.image.large.viewing.key" = - "https://vscord.catppuccin.com/mocha/{lang}.webp"; - "vscord.status.image.small.debugging.key" = - "https://vscord.catppuccin.com/mocha/debugging.webp"; - "vscord.status.image.small.editing.key" = - "https://vscord.catppuccin.com/mocha/{app_id}.webp"; - "vscord.status.image.small.idle.key" = - "https://vscord.catppuccin.com/mocha/idle.webp"; - "vscord.status.image.small.notInFile.key" = - "https://vscord.catppuccin.com/mocha/idle.webp"; - "vscord.status.image.small.viewing.key" = - "https://vscord.catppuccin.com/mocha/{app_id}.webp"; + "vscord.status.image.large.debugging.key" = "https://vscord.catppuccin.com/mocha/debugging.webp"; + "vscord.status.image.large.editing.key" = "https://vscord.catppuccin.com/mocha/{lang}.webp"; + "vscord.status.image.large.idle.key" = "https://vscord.catppuccin.com/mocha/idle-{app_id}.webp"; + "vscord.status.image.large.notInFile.key" = "https://vscord.catppuccin.com/mocha/idle-{app_id}.webp"; + "vscord.status.image.large.viewing.key" = "https://vscord.catppuccin.com/mocha/{lang}.webp"; + "vscord.status.image.small.debugging.key" = "https://vscord.catppuccin.com/mocha/debugging.webp"; + "vscord.status.image.small.editing.key" = "https://vscord.catppuccin.com/mocha/{app_id}.webp"; + "vscord.status.image.small.idle.key" = "https://vscord.catppuccin.com/mocha/idle.webp"; + "vscord.status.image.small.notInFile.key" = "https://vscord.catppuccin.com/mocha/idle.webp"; + "vscord.status.image.small.viewing.key" = "https://vscord.catppuccin.com/mocha/{app_id}.webp"; "git.enableSmartCommit" = true; "git.autofetch" = true; "git.confirmSync" = false; @@ -292,20 +322,21 @@ "editor.accessibilitySupport" = "off"; "git.inputValidationSubjectLength" = null; "git.inputValidationLength" = 150; - "editor.fontLigatures" = - "'cv01', 'cv02', 'ss05', 'ss08', 'ss03', 'cv29', 'cv30', 'cv11'"; + "editor.fontLigatures" = "'cv01', 'cv02', 'ss05', 'ss08', 'ss03', 'cv29', 'cv30', 'cv11'"; "workbench.iconTheme" = "catppuccin-latte"; - "catppuccin.syncWithIconPack" = false; + "catppuccin.syncWithIconPack" = false; "codesnap.shutterAction" = "copy"; "codesnap.transparentBackground" = true; "codesnap.realLineNumbers" = true; "codesnap.roundedCorners" = true; "codesnap.showWindowTitle" = true; "codesnap.showWindowControls" = false; - "gitlens.remotes" = [{ - "domain" = "www.coastalcommits.com"; - "type" = "Gitea"; - }]; + "gitlens.remotes" = [ + { + "domain" = "www.coastalcommits.com"; + "type" = "Gitea"; + } + ]; "markdownlint.config" = { "ol-prefix" = false; "html" = false; @@ -326,26 +357,27 @@ "**/xonsh/*.py" = "xonsh"; }; "editor.semanticHighlighting.enabled" = true; - "[css]" = { "editor.defaultFormatter" = "vscode.css-language-features"; }; + "[css]" = { + "editor.defaultFormatter" = "vscode.css-language-features"; + }; "git.ignoreRebaseWarning" = true; "remote.autoForwardPortsSource" = "hybrid"; "git.replaceTagsWhenPull" = true; "redhat.telemetry.enabled" = true; "editor.fontSize" = 14; "workbench.colorTheme" = "Catppuccin Mocha"; - "editor.codeLensFontFamily" = - "'ComicCodeLigatures Nerd Font', 'Comic Code Ligatures', 'FiraCode Nerd Font'"; - "editor.inlayHints.fontFamily" = - "'ComicCodeLigatures Nerd Font', 'Comic Code Ligatures', 'FiraCode Nerd Font', 'FiraCode Nerd Font Light'"; - "editor.fontFamily" = - "'ComicCodeLigatures Nerd Font', 'Comic Code Ligatures', 'FiraCode Nerd Font'"; + "editor.codeLensFontFamily" = "'ComicCodeLigatures Nerd Font', 'Comic Code Ligatures', 'FiraCode Nerd Font'"; + "editor.inlayHints.fontFamily" = "'ComicCodeLigatures Nerd Font', 'Comic Code Ligatures', 'FiraCode Nerd Font', 'FiraCode Nerd Font Light'"; + "editor.fontFamily" = "'ComicCodeLigatures Nerd Font', 'Comic Code Ligatures', 'FiraCode Nerd Font'"; "explorer.confirmDelete" = false; "window.confirmSaveUntitledWorkspace" = false; "cwtools.cache.stellaris" = "/bulk/steam/steamapps/common/Stellaris"; "python.analysis.inlayHints.callArgumentNames" = "partial"; "python.analysis.inlayHints.functionReturnTypes" = true; "explorer.confirmDragAndDrop" = false; - "editor.unicodeHighlight.allowedLocales" = { ru = true; }; + "editor.unicodeHighlight.allowedLocales" = { + ru = true; + }; "terminal.integrated.defaultProfile.linux" = "xonsh"; "explorer.confirmPasteNative" = false; "editor.renderWhitespace" = "none"; @@ -355,8 +387,7 @@ "*.jsx" = "\${capture}.js"; "*.tsx" = "\${capture}.ts"; "tsconfig.json" = "tsconfig.*.json"; - "package.json" = - "package-lock.json, yarn.lock, pnpm-lock.yaml, bun.lockb"; + "package.json" = "package-lock.json, yarn.lock, pnpm-lock.yaml, bun.lockb"; "Cargo.toml" = "Cargo.lock"; "*.sqlite" = "\${capture}.\${extname}-*"; "*.db" = "\${capture}.\${extname}-*"; @@ -369,7 +400,9 @@ "editor.defaultFormatter" = "shakram02.bash-beautify"; }; "vscord.app.name" = "Visual Studio Code"; - "workbench.editorAssociations" = { "*.db" = "sqlite3-editor.editor"; }; + "workbench.editorAssociations" = { + "*.db" = "sqlite3-editor.editor"; + }; "vs-code-prettier-eslint.prettierLast" = false; "typescript.updateImportsOnFileMove.enabled" = "always"; "supermaven.allowGitignore" = true; @@ -380,11 +413,14 @@ "editor.defaultFormatter" = "vscode.json-language-features"; }; "go.toolsManagement.autoUpdate" = true; - "remote.SSH.remotePlatform" = { "eclipse" = "linux"; }; + "remote.SSH.remotePlatform" = { + "eclipse" = "linux"; + }; "terminal.integrated.fontWeightBold" = "bold"; - "terminal.integrated.fontFamily" = - "'ComicCodeLigatures Nerd Font', 'Comic Code Ligatures', 'FiraCode Nerd Font'"; - "[jsonc]" = { "editor.defaultFormatter" = "esbenp.prettier-vscode"; }; + "terminal.integrated.fontFamily" = "'ComicCodeLigatures Nerd Font', 'Comic Code Ligatures', 'FiraCode Nerd Font'"; + "[jsonc]" = { + "editor.defaultFormatter" = "esbenp.prettier-vscode"; + }; }; }; } diff --git a/hosts/eclipse.nix b/hosts/eclipse.nix index c574825..d10faf3 100644 --- a/hosts/eclipse.nix +++ b/hosts/eclipse.nix @@ -1,37 +1,54 @@ # Do not modify this file! It was generated by ‘nixos-generate-config’ # and may be overwritten by future invocations. Please make changes # to /etc/nixos/configuration.nix instead. -{ config, lib, pkgs, modulesPath, ... }: +{ + config, + lib, + pkgs, + modulesPath, + ... +}: { - imports = - [ (modulesPath + "/installer/scan/not-detected.nix") - ]; + imports = [ + (modulesPath + "/installer/scan/not-detected.nix") + ]; - boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usbhid" "sd_mod" "sr_mod" "rtsx_usb_sdmmc" ]; + boot.initrd.availableKernelModules = [ + "xhci_pci" + "ahci" + "nvme" + "usbhid" + "sd_mod" + "sr_mod" + "rtsx_usb_sdmmc" + ]; boot.initrd.kernelModules = [ ]; boot.kernelModules = [ "kvm-amd" ]; boot.extraModulePackages = [ ]; - fileSystems."/" = - { device = "/dev/disk/by-uuid/f65ec459-c974-4032-8224-fa78c57527c2"; - fsType = "ext4"; - }; + fileSystems."/" = { + device = "/dev/disk/by-uuid/f65ec459-c974-4032-8224-fa78c57527c2"; + fsType = "ext4"; + }; - fileSystems."/boot" = - { device = "/dev/disk/by-uuid/484E-279A"; - fsType = "vfat"; - options = [ "fmask=0077" "dmask=0077" ]; - }; - - fileSystems."/bulk" = - { device = "/dev/disk/by-uuid/3b8e0789-def6-45dd-8eff-7b55b74569ce"; - fsType = "ext4"; - }; - - swapDevices = - [ { device = "/dev/disk/by-uuid/4eab8c8f-85c5-4a04-a03c-e111ada06ec0"; } + fileSystems."/boot" = { + device = "/dev/disk/by-uuid/484E-279A"; + fsType = "vfat"; + options = [ + "fmask=0077" + "dmask=0077" ]; + }; + + fileSystems."/bulk" = { + device = "/dev/disk/by-uuid/3b8e0789-def6-45dd-8eff-7b55b74569ce"; + fsType = "ext4"; + }; + + swapDevices = [ + { device = "/dev/disk/by-uuid/4eab8c8f-85c5-4a04-a03c-e111ada06ec0"; } + ]; # Enables DHCP on each ethernet and wireless interface. In case of scripted networking # (the default) this is the recommended approach. When using systemd-networkd it's diff --git a/hosts/nebula.nix b/hosts/nebula.nix index 01fd98f..9e4c9d9 100644 --- a/hosts/nebula.nix +++ b/hosts/nebula.nix @@ -1,22 +1,33 @@ # Do not modify this file! It was generated by ‘nixos-generate-config’ # and may be overwritten by future invocations. Please make changes # to /etc/nixos/configuration.nix instead. -{ config, lib, pkgs, modulesPath, ... }: +{ + config, + lib, + pkgs, + modulesPath, + ... +}: { - imports = - [ (modulesPath + "/installer/scan/not-detected.nix") - ]; + imports = [ + (modulesPath + "/installer/scan/not-detected.nix") + ]; - boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "usbhid" "sd_mod" ]; + boot.initrd.availableKernelModules = [ + "xhci_pci" + "ahci" + "usbhid" + "sd_mod" + ]; boot.initrd.kernelModules = [ ]; boot.kernelModules = [ "kvm-amd" ]; boot.extraModulePackages = [ ]; - fileSystems."/" = - { device = "/dev/disk/by-uuid/658d4465-7bac-4e12-ad92-00fef8abcfe3"; - fsType = "ext4"; - }; + fileSystems."/" = { + device = "/dev/disk/by-uuid/658d4465-7bac-4e12-ad92-00fef8abcfe3"; + fsType = "ext4"; + }; swapDevices = [ ]; diff --git a/hosts/virtual-machines/gnome/default.nix b/hosts/virtual-machines/gnome/default.nix index f1a2416..8ba99fc 100644 --- a/hosts/virtual-machines/gnome/default.nix +++ b/hosts/virtual-machines/gnome/default.nix @@ -2,7 +2,8 @@ let gnomeExtensions = with pkgs.gnomeExtensions; [ totp ]; packages = with pkgs; [ fastfetch ]; -in { +in +{ imports = [ ../template.nix #../../../nixos/shell.nix diff --git a/hosts/virtual-machines/nixpkgs/default.nix b/hosts/virtual-machines/nixpkgs/default.nix index fcd8c63..a74359e 100644 --- a/hosts/virtual-machines/nixpkgs/default.nix +++ b/hosts/virtual-machines/nixpkgs/default.nix @@ -1,4 +1,5 @@ -{ pkgs, ... }: { +{ pkgs, ... }: +{ imports = [ ../template.nix ../../../nixos/shell.nix diff --git a/nixos/catppuccin.nix b/nixos/catppuccin.nix index 59fe4bd..a709447 100644 --- a/nixos/catppuccin.nix +++ b/nixos/catppuccin.nix @@ -1,16 +1,25 @@ -{ pkgs, ... }: { +{ pkgs, ... }: +{ environment.systemPackages = with pkgs; [ # catppuccin (catppuccin.override { variant = "mocha"; - accent ="blue"; - themeList = [ "bat" "lazygit" ]; + accent = "blue"; + themeList = [ + "bat" + "lazygit" + ]; }) catppuccin-cursors # catppuccin for kde plasma (catppuccin-kde.override { - flavour = [ "mocha" "macchiato" "frappe" "latte" ]; + flavour = [ + "mocha" + "macchiato" + "frappe" + "latte" + ]; accents = [ "blue" ]; winDecStyles = [ "classic" ]; }) diff --git a/nixos/configuration.nix b/nixos/configuration.nix index 8f94ce5..30bf2a0 100755 --- a/nixos/configuration.nix +++ b/nixos/configuration.nix @@ -5,8 +5,14 @@ { nix = { settings = { - experimental-features = [ "nix-command" "flakes" ]; - trusted-users = [ "root" "@wheel" ]; + experimental-features = [ + "nix-command" + "flakes" + ]; + trusted-users = [ + "root" + "@wheel" + ]; }; }; @@ -90,7 +96,11 @@ users.users.cswimr = { isNormalUser = true; description = "Seaswimmer"; - extraGroups = [ "networkmanager" "wheel" "docker" ]; + extraGroups = [ + "networkmanager" + "wheel" + "docker" + ]; openssh = { authorizedKeys.keys = [ "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILOka7plvb0hAwDq04mb+hs+a+P3XDhyYyvhw1L5tvlz cswimr@eclipse" diff --git a/nixos/development.nix b/nixos/development.nix index 6676a5a..5f31314 100644 --- a/nixos/development.nix +++ b/nixos/development.nix @@ -1,4 +1,5 @@ -{ pkgs, ... }: { +{ pkgs, ... }: +{ environment.systemPackages = with pkgs; [ devenv ]; programs.direnv = { diff --git a/nixos/environment.nix b/nixos/environment.nix index 7b427bf..473ea29 100644 --- a/nixos/environment.nix +++ b/nixos/environment.nix @@ -1,4 +1,5 @@ -{ lib, ... }: { +{ lib, ... }: +{ environment.variables = { PATH = "$PATH:/etc/nixos/scripts"; EDITOR = "nvim"; diff --git a/nixos/flatpak.nix b/nixos/flatpak.nix index c091d3d..2891896 100644 --- a/nixos/flatpak.nix +++ b/nixos/flatpak.nix @@ -1,8 +1,11 @@ { - services.flatpak = { - enable = true; - packages = [ - { flatpakref = "https://sober.vinegarhq.org/sober.flatpakref"; sha256 = "1pj8y1xhiwgbnhrr3yr3ybpfis9slrl73i0b1lc9q89vhip6ym2l"; } - ]; - }; + services.flatpak = { + enable = true; + packages = [ + { + flatpakref = "https://sober.vinegarhq.org/sober.flatpakref"; + sha256 = "1pj8y1xhiwgbnhrr3yr3ybpfis9slrl73i0b1lc9q89vhip6ym2l"; + } + ]; + }; } diff --git a/nixos/gaming.nix b/nixos/gaming.nix index 9f53de8..7b2954d 100644 --- a/nixos/gaming.nix +++ b/nixos/gaming.nix @@ -1,4 +1,5 @@ -{ pkgs, ... }: { +{ pkgs, ... }: +{ programs.steam = { enable = true; remotePlay.openFirewall = true; # Open ports in the firewall for Steam Remote Play diff --git a/nixos/git.nix b/nixos/git.nix index 9a730be..30a5487 100755 --- a/nixos/git.nix +++ b/nixos/git.nix @@ -1,8 +1,12 @@ { programs.git = { config = { - init = { defaultBranch = "master"; }; - safe = { directory = "/etc/nixos"; }; + init = { + defaultBranch = "master"; + }; + safe = { + directory = "/etc/nixos"; + }; url = { "https://www.coastalcommits.com/" = { insteadOf = [ diff --git a/nixos/gui-pkgs.nix b/nixos/gui-pkgs.nix index 5909a5e..20934fd 100644 --- a/nixos/gui-pkgs.nix +++ b/nixos/gui-pkgs.nix @@ -1,4 +1,10 @@ -{ pkgs, inputs, system, lib, ... }: +{ + pkgs, + inputs, + system, + lib, + ... +}: let kdePackages = with pkgs.kdePackages; [ plasma-browser-integration ]; packages = with pkgs; [ @@ -13,9 +19,9 @@ let libnotify ]; flakePackages = with inputs; [ zen-browser.packages.${system}.specific ]; -in { - environment.systemPackages = - lib.lists.unique (kdePackages ++ packages ++ flakePackages); +in +{ + environment.systemPackages = lib.lists.unique (kdePackages ++ packages ++ flakePackages); # Enable the X11 windowing system. # You can leave this disabled if you're only using the Wayland session. @@ -44,8 +50,7 @@ in { enable = true; after = [ "network.target" ]; wantedBy = [ "default.target" ]; - description = - "A GUI to monitor and manage Tailscale on your Linux desktop, built using KDE Frameworks and Kirigami2."; + description = "A GUI to monitor and manage Tailscale on your Linux desktop, built using KDE Frameworks and Kirigami2."; serviceConfig = { Type = "simple"; ExecStart = "${pkgs.ktailctl}/bin/ktailctl"; diff --git a/nixos/nvidia.nix b/nixos/nvidia.nix index 2afa881..ad9f9d8 100755 --- a/nixos/nvidia.nix +++ b/nixos/nvidia.nix @@ -1,6 +1,9 @@ -{ config, ... }: { +{ config, ... }: +{ # Enable OpenGL - hardware.graphics = { enable = true; }; + hardware.graphics = { + enable = true; + }; # Load nvidia driver for Xorg / Wayland services.xserver.videoDrivers = [ "nvidia" ]; diff --git a/nixos/nvim.nix b/nixos/nvim.nix index a95847f..02e4610 100755 --- a/nixos/nvim.nix +++ b/nixos/nvim.nix @@ -1,4 +1,5 @@ -{ pkgs, ... }: { +{ pkgs, ... }: +{ programs.nixvim = { extraPackages = with pkgs; [ fd ]; enable = true; diff --git a/nixos/pkg.nix b/nixos/pkg.nix index 5b5549f..c810925 100644 --- a/nixos/pkg.nix +++ b/nixos/pkg.nix @@ -1,4 +1,10 @@ -{ pkgs, lib, inputs, system, ... }: +{ + pkgs, + lib, + inputs, + system, + ... +}: let # List of packages installed in system profile. To search, run: # $ nix search wget @@ -38,7 +44,7 @@ let lazygit lazydocker bat - nixfmt + nixfmt-rfc-style zenity forgejo-runner # for some reason this installs forgejo-runner as act_runner libwebp @@ -55,11 +61,14 @@ let python311Packages.rich ]; flakePackages = with inputs; [ compose2nix.packages.${system}.default ]; -in { +in +{ environment.systemPackages = lib.lists.unique (packages ++ flakePackages); # install docker - virtualisation.docker = { enable = true; }; + virtualisation.docker = { + enable = true; + }; # remove nano programs.nano.enable = false; diff --git a/nixos/shell.nix b/nixos/shell.nix index 8127f6e..10bdd37 100644 --- a/nixos/shell.nix +++ b/nixos/shell.nix @@ -1,17 +1,16 @@ -{ config, pkgs, ... }: { +{ config, pkgs, ... }: +{ #TODO: Submit a PR to nixpkgs to add xonsh support to the Starship module # After that, we can remove this import and the disabledModules line disabledModules = [ "programs/starship.nix" ]; - imports = - [ /bulk/home/cswimr/Projects/nixpkgs/nixos/modules/programs/starship.nix ]; + imports = [ /bulk/home/cswimr/Projects/nixpkgs/nixos/modules/programs/starship.nix ]; # starship - a customizable prompt for any shell programs.starship = { enable = true; # custom settings settings = { - format = - "[](bg:#1e1e2e fg:#a6e3a1)$username$hostname[](fg:#a6e3a1 bg:#89b4fa)$directory[](fg:#89b4fa bg:#cba6f7)$direnv[](fg:#cba6f7 bg:#f9e2af)$git_branch$git_status[](fg:#f9e2af bg:#1e1e2e)$character"; + format = "[](bg:#1e1e2e fg:#a6e3a1)$username$hostname[](fg:#a6e3a1 bg:#89b4fa)$directory[](fg:#89b4fa bg:#cba6f7)$direnv[](fg:#cba6f7 bg:#f9e2af)$git_branch$git_status[](fg:#f9e2af bg:#1e1e2e)$character"; username = { show_always = true; format = "[ $user@]($style)"; @@ -69,97 +68,98 @@ programs.bash.completion.enable = true; users.defaultUserShell = pkgs.xonsh; - programs.xonsh = let bashcfg = config.programs.bash; - in { - enable = true; - config = '' - $BASH_COMPLETIONS = ('${bashcfg.completion.package}/etc/profile.d/bash_completion.sh') - $UPDATE_OS_ENVIRON = True - $XONTRIB_CLP_ALIAS = 'shutil' - #xontrib load cd - xontrib load clp - xontrib load direnv - xontrib load sh - ''; - package = pkgs.xonsh.override { - extraPackages = ps: [ - pkgs.python311Packages.rich - # (ps.buildPythonPackage rec { - # name = "xontrib-cd"; - # version = "0.3.1"; + programs.xonsh = + let + bashcfg = config.programs.bash; + in + { + enable = true; + config = '' + $BASH_COMPLETIONS = ('${bashcfg.completion.package}/etc/profile.d/bash_completion.sh') + $UPDATE_OS_ENVIRON = True + $XONTRIB_CLP_ALIAS = 'shutil' + #xontrib load cd + xontrib load clp + xontrib load direnv + xontrib load sh + ''; + package = pkgs.xonsh.override { + extraPackages = ps: [ + pkgs.python311Packages.rich + # (ps.buildPythonPackage rec { + # name = "xontrib-cd"; + # version = "0.3.1"; - # src = pkgs.fetchFromGitHub { - # owner = "eugenesvk"; - # repo = name; - # rev = version; - # sha256 = "XxSxjyCg7PeX1v3e2KKicvAPmNeq+qVqbW4fXTwAiic="; - # }; + # src = pkgs.fetchFromGitHub { + # owner = "eugenesvk"; + # repo = name; + # rev = version; + # sha256 = "XxSxjyCg7PeX1v3e2KKicvAPmNeq+qVqbW4fXTwAiic="; + # }; - # meta = { - # homepage = "https://github.com/eugenesvk/xontrib-cd"; - # description = - # "`cd` to any path without escaping in xonsh shell: `cd ~/[te] st`"; - # license = pkgs.lib.licenses.mit; - # maintainers = [ "cswimr" ]; - # }; - # }) - (ps.buildPythonPackage rec { - name = "xontrib-clp"; - version = "0.1.7"; + # meta = { + # homepage = "https://github.com/eugenesvk/xontrib-cd"; + # description = + # "`cd` to any path without escaping in xonsh shell: `cd ~/[te] st`"; + # license = pkgs.lib.licenses.mit; + # maintainers = [ "cswimr" ]; + # }; + # }) + (ps.buildPythonPackage rec { + name = "xontrib-clp"; + version = "0.1.7"; - src = pkgs.fetchFromGitHub { - owner = "anki-code"; - repo = name; - rev = version; - sha256 = "1ewWlwG8KY9s6qydErurvP2x+4DIPTFcjSGP1c5y83M="; - }; + src = pkgs.fetchFromGitHub { + owner = "anki-code"; + repo = name; + rev = version; + sha256 = "1ewWlwG8KY9s6qydErurvP2x+4DIPTFcjSGP1c5y83M="; + }; - meta = { - homepage = "https://github.com/anki-code/xontrib-clp"; - description = - "Copy output to clipboard. Cross-platform."; - license = pkgs.lib.licenses.mit; - maintainers = [ "cswimr" ]; - }; - }) - (ps.buildPythonPackage rec { - name = "xonsh-direnv"; - version = "1.6.5"; + meta = { + homepage = "https://github.com/anki-code/xontrib-clp"; + description = "Copy output to clipboard. Cross-platform."; + license = pkgs.lib.licenses.mit; + maintainers = [ "cswimr" ]; + }; + }) + (ps.buildPythonPackage rec { + name = "xonsh-direnv"; + version = "1.6.5"; - src = pkgs.fetchFromGitHub { - owner = "74th"; - repo = name; - rev = version; - sha256 = "huBJ7WknVCk+WgZaXHlL+Y1sqsn6TYqMP29/fsUPSyU="; - }; + src = pkgs.fetchFromGitHub { + owner = "74th"; + repo = name; + rev = version; + sha256 = "huBJ7WknVCk+WgZaXHlL+Y1sqsn6TYqMP29/fsUPSyU="; + }; - meta = { - homepage = "https://github.com/74th/xonsh-direnv"; - description = "xonsh extension for using direnv"; - license = pkgs.lib.licenses.mit; - maintainers = [ "cswimr" ]; - }; - }) - (ps.buildPythonPackage rec { - name = "xontrib-sh"; - version = "0.3.1"; + meta = { + homepage = "https://github.com/74th/xonsh-direnv"; + description = "xonsh extension for using direnv"; + license = pkgs.lib.licenses.mit; + maintainers = [ "cswimr" ]; + }; + }) + (ps.buildPythonPackage rec { + name = "xontrib-sh"; + version = "0.3.1"; - src = pkgs.fetchFromGitHub { - owner = "anki-code"; - repo = name; - rev = version; - sha256 = "KL/AxcsvjxqxvjDlf1axitgME3T+iyuW6OFb1foRzN8="; - }; + src = pkgs.fetchFromGitHub { + owner = "anki-code"; + repo = name; + rev = version; + sha256 = "KL/AxcsvjxqxvjDlf1axitgME3T+iyuW6OFb1foRzN8="; + }; - meta = { - homepage = "https://github.com/anki-code/xontrib-sh"; - description = - "Paste and run commands from bash, zsh, fish, tcsh in xonsh shell."; - license = pkgs.lib.licenses.mit; - maintainers = [ "cswimr" ]; - }; - }) - ]; + meta = { + homepage = "https://github.com/anki-code/xontrib-sh"; + description = "Paste and run commands from bash, zsh, fish, tcsh in xonsh shell."; + license = pkgs.lib.licenses.mit; + maintainers = [ "cswimr" ]; + }; + }) + ]; + }; }; - }; } diff --git a/nixos/sudo.nix b/nixos/sudo.nix index 5ee4631..ddce21b 100755 --- a/nixos/sudo.nix +++ b/nixos/sudo.nix @@ -1,9 +1,16 @@ { - security.sudo.extraRules = [{ - users = [ "cswimr" ]; - commands = [{ - command = "ALL"; - options = [ "SETENV" "NOPASSWD" ]; - }]; - }]; + security.sudo.extraRules = [ + { + users = [ "cswimr" ]; + commands = [ + { + command = "ALL"; + options = [ + "SETENV" + "NOPASSWD" + ]; + } + ]; + } + ]; } diff --git a/nixos/tailscale.nix b/nixos/tailscale.nix index 93256c7..ef9aa44 100755 --- a/nixos/tailscale.nix +++ b/nixos/tailscale.nix @@ -5,6 +5,11 @@ # with the contents of your Tailscale auth key. # Make sure your permissions are set correctly, e.g. 0600. authKeyFile = "/run/secrets/tailscale"; - extraUpFlags = [ "--ssh" "--accept-routes" "--accept-dns" "--operator=cswimr" ]; + extraUpFlags = [ + "--ssh" + "--accept-routes" + "--accept-dns" + "--operator=cswimr" + ]; }; } diff --git a/scripts/nix/python.nix b/scripts/nix/python.nix index 7d7a71a..02c2eb7 100644 --- a/scripts/nix/python.nix +++ b/scripts/nix/python.nix @@ -3,7 +3,8 @@ let config = { }; overlays = [ ]; }; -in pkgs.mkShellNoCC { +in +pkgs.mkShellNoCC { packages = with pkgs; [ libnotify python312