From 3bfebb286d289761f60afe25b265dd5927d405c1 Mon Sep 17 00:00:00 2001 From: LunarAkai Date: Sun, 16 Mar 2025 19:45:20 +0100 Subject: [PATCH] stuff? --- flake.lock | 65 +++++++++++++++++-- flake.nix | 10 ++- home-manager/luna/categories/cli/default.nix | 3 + home-manager/luna/categories/cli/gh.nix | 8 +++ home-manager/luna/categories/cli/git.nix | 11 ++++ home-manager/luna/categories/cli/tmux.nix | 31 +++++++++ .../luna/categories/cli/zsh/default.nix | 4 ++ .../desktop/coding/vscode/default.nix | 38 +++++++++++ home-manager/luna/hummingbird.nix | 1 + hosts/common/optional/docker.nix | 5 ++ hosts/common/users/luna/default.nix | 10 +-- hosts/hummingbird/configuration.nix | 4 ++ hosts/spider/hardware-configuration.nix | 49 +++++++------- overlays/default.nix | 30 +++++++++ 14 files changed, 235 insertions(+), 34 deletions(-) create mode 100644 home-manager/luna/categories/cli/gh.nix create mode 100644 home-manager/luna/categories/cli/git.nix create mode 100644 home-manager/luna/categories/cli/tmux.nix create mode 100644 home-manager/luna/categories/desktop/coding/vscode/default.nix create mode 100644 hosts/common/optional/docker.nix create mode 100644 overlays/default.nix diff --git a/flake.lock b/flake.lock index 1a5a0ca..2d37867 100644 --- a/flake.lock +++ b/flake.lock @@ -80,11 +80,11 @@ "systems": "systems_2" }, "locked": { - "lastModified": 1694529238, - "narHash": "sha256-zsNZZGTGnMOf9YpHKJqMSsa0dXbfmxeoJ7xHlrt+xmY=", + "lastModified": 1731533236, + "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", "owner": "numtide", "repo": "flake-utils", - "rev": "ff7b65b44d01cf9ba6a71320833626af21126384", + "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", "type": "github" }, "original": { @@ -95,7 +95,7 @@ }, "flake-utils-plus": { "inputs": { - "flake-utils": "flake-utils" + "flake-utils": "flake-utils_2" }, "locked": { "lastModified": 1696331477, @@ -111,6 +111,24 @@ "type": "github" } }, + "flake-utils_2": { + "inputs": { + "systems": "systems_3" + }, + "locked": { + "lastModified": 1694529238, + "narHash": "sha256-zsNZZGTGnMOf9YpHKJqMSsa0dXbfmxeoJ7xHlrt+xmY=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "ff7b65b44d01cf9ba6a71320833626af21126384", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, "flakeCompat": { "flake": false, "locked": { @@ -167,6 +185,27 @@ "type": "github" } }, + "nix-vscode-extensions": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1742090119, + "narHash": "sha256-I+NlLtHpTsItYkHo4fFdM6moBHF156wM11TPWLcwdic=", + "owner": "nix-community", + "repo": "nix-vscode-extensions", + "rev": "adcb8b54d64484bb74f1480acefc3c686f318917", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nix-vscode-extensions", + "type": "github" + } + }, "nixos-appstream-data": { "inputs": { "flake-utils": [ @@ -282,10 +321,11 @@ "alejandra": "alejandra", "home-manager": "home-manager", "nix-software-center": "nix-software-center", + "nix-vscode-extensions": "nix-vscode-extensions", "nixos-conf-editor": "nixos-conf-editor", "nixpkgs": "nixpkgs_3", "nixpkgs-stable": "nixpkgs-stable", - "systems": "systems_3" + "systems": "systems_4" } }, "rust-analyzer-src": { @@ -359,6 +399,21 @@ } }, "systems_3": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "systems_4": { "locked": { "lastModified": 1681028828, "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", diff --git a/flake.nix b/flake.nix index add84fb..e54c100 100644 --- a/flake.nix +++ b/flake.nix @@ -11,6 +11,11 @@ nix-software-center.url = "github:snowfallorg/nix-software-center"; nixos-conf-editor.url = "github:snowfallorg/nixos-conf-editor"; + nix-vscode-extensions = { + url = "github:nix-community/nix-vscode-extensions"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + home-manager = { url = "github:nix-community/home-manager"; inputs.nixpkgs.follows = "nixpkgs"; @@ -39,11 +44,12 @@ in { inherit lib; - formatter = forEachSystem (pkgs: pkgs.alejandra); - homeManagerModules.default = ./modules/home-manager; nixosModules.default = ./modules/nixos; + overlays = import ./overlays {inherit inputs outputs;}; + formatter = forEachSystem (pkgs: pkgs.alejandra); + nixosConfigurations = { # Yes, my computers are named after the Earthbound Immortals from Yu-Gi-Oh! 5D's :3 diff --git a/home-manager/luna/categories/cli/default.nix b/home-manager/luna/categories/cli/default.nix index 5bb386d..12e818e 100644 --- a/home-manager/luna/categories/cli/default.nix +++ b/home-manager/luna/categories/cli/default.nix @@ -1,7 +1,10 @@ {pkgs, ...}: { imports = [ ./zsh + ./gh.nix + ./git.nix ./oh-my-posh.nix + ./tmux.nix ]; home.packages = with pkgs; [ diff --git a/home-manager/luna/categories/cli/gh.nix b/home-manager/luna/categories/cli/gh.nix new file mode 100644 index 0000000..9120613 --- /dev/null +++ b/home-manager/luna/categories/cli/gh.nix @@ -0,0 +1,8 @@ +{ + programs.gh = { + enable = true; + settings = { + git_protocol = "ssh"; + }; + }; +} diff --git a/home-manager/luna/categories/cli/git.nix b/home-manager/luna/categories/cli/git.nix new file mode 100644 index 0000000..d821e09 --- /dev/null +++ b/home-manager/luna/categories/cli/git.nix @@ -0,0 +1,11 @@ +{lib, ...}: { + programs.git = { + enable = true; + userName = lib.mkDefault "LunarAkai"; + userEmail = lib.mkDefault "akai@lunarakai.de"; + extraConfig = { + init.defaultBranch = "main"; + }; + lfs.enable = true; + }; +} diff --git a/home-manager/luna/categories/cli/tmux.nix b/home-manager/luna/categories/cli/tmux.nix new file mode 100644 index 0000000..7764e78 --- /dev/null +++ b/home-manager/luna/categories/cli/tmux.nix @@ -0,0 +1,31 @@ +{pkgs, ...}: { + programs.tmux = { + enable = true; + prefix = "C-Space"; + baseIndex = 1; + newSession = true; + + mouse = true; + clock24 = true; + escapeTime = 0; + shell = "${pkgs.zsh} /bin/zsh"; + + plugins = with pkgs; [ + tmuxPlugins.yank + tmuxPlugins.sensible + tmuxPlugins.catppuccin + ]; + + extraConfig = '' + # set true color + set-option -sa terminal-overrides ",xterm*:Tc" + + # open panes in current directory + bind '"' split-window -v -c "#{pane_current_path}" + bind % split-window -h -c "#{pane_current_path}" + + # easy reloads + bind M-r source-file ~/.config/tmux/tmux.conf + ''; + }; +} diff --git a/home-manager/luna/categories/cli/zsh/default.nix b/home-manager/luna/categories/cli/zsh/default.nix index ab522a6..564928d 100644 --- a/home-manager/luna/categories/cli/zsh/default.nix +++ b/home-manager/luna/categories/cli/zsh/default.nix @@ -7,6 +7,10 @@ oh-my-zsh = { enable = true; + plugins = [ + "gh" + "rust" + ]; }; history.size = 10000; }; diff --git a/home-manager/luna/categories/desktop/coding/vscode/default.nix b/home-manager/luna/categories/desktop/coding/vscode/default.nix new file mode 100644 index 0000000..028daae --- /dev/null +++ b/home-manager/luna/categories/desktop/coding/vscode/default.nix @@ -0,0 +1,38 @@ +{pkgs, ...}: { + programs.vscode = { + enable = true; + extensions = with pkgs.vscode-marketplace; [ + golang.go + + redhat.java + redhat.ansible + redhat.vscode-yaml + + rust-lang.rust-analyzer + ritwickdey.liveserver + ecmel.vscode-html-css + mhutchie.git-graph + pixl-garden.bongocat + + # theme + catppuccin.catppuccin-vsc + catppuccin.catppuccin-vsc-icons + ]; + profiles.default.userSettings = { + # pls stop adding generative "AI" to everything :c + "chat.agent.enabled" = false; + "chat.commandCenter.enabled" = false; + + "editor.semanticHighlighting.enabled" = true; + "terminal.integrated.minimumContrastRatio" = 1; + "window.titleBarStyle" = "custom"; + + "workbench.colorTheme" = "Catppuccin Macchiato"; + "catppuccin.accentColor" = "mauve"; + "catppuccin.customUIColors"."mauve"."statusBar.foreground" = "accent"; + + "workbench.iconTheme" = "catppuccin-macchiato"; + "[nix]"."editor.tabSize" = 2; + }; + }; +} diff --git a/home-manager/luna/hummingbird.nix b/home-manager/luna/hummingbird.nix index 394bab0..aa48ba4 100644 --- a/home-manager/luna/hummingbird.nix +++ b/home-manager/luna/hummingbird.nix @@ -4,5 +4,6 @@ ./categories/cli ./categories/desktop/common + ./categories/desktop/coding/vscode ]; } diff --git a/hosts/common/optional/docker.nix b/hosts/common/optional/docker.nix new file mode 100644 index 0000000..a0f86ac --- /dev/null +++ b/hosts/common/optional/docker.nix @@ -0,0 +1,5 @@ +{ + virtualisation.docker = { + enable = true; + }; +} diff --git a/hosts/common/users/luna/default.nix b/hosts/common/users/luna/default.nix index 401807c..61159d6 100644 --- a/hosts/common/users/luna/default.nix +++ b/hosts/common/users/luna/default.nix @@ -2,23 +2,25 @@ pkgs, config, ... -}: { +}: let + ifTheyExist = groups: builtins.filter (group: builtins.hasAttr group config.users.groups) groups; +in { # Define a user account. Don't forget to set a password with ‘passwd’. users.users.luna = { isNormalUser = true; description = "luna"; shell = pkgs.zsh; - extraGroups = [ + extraGroups = ifTheyExist [ + "audio" + "docker" "networkmanager" "wheel" ]; packages = with pkgs; [ # thunderbird gnome-software - git neovim rustup - vscode.fhs protonvpn-gui ]; }; diff --git a/hosts/hummingbird/configuration.nix b/hosts/hummingbird/configuration.nix index 39bb0a2..5e76f94 100644 --- a/hosts/hummingbird/configuration.nix +++ b/hosts/hummingbird/configuration.nix @@ -17,6 +17,7 @@ ../common/optional/pipewire.nix ../common/optional/flatpak.nix ../common/optional/ckb-next.nix + ../common/optional/docker.nix # Include the results of the hardware scan. ./hardware-configuration.nix @@ -67,4 +68,7 @@ remotePlay.openFirewall = true; # Open ports in the firewall for Steam Remote Play dedicatedServer.openFirewall = true; # Open ports in the firewall for Source Dedicated Server }; + nixpkgs.overlays = [ + inputs.nix-vscode-extensions.overlays.default + ]; } diff --git a/hosts/spider/hardware-configuration.nix b/hosts/spider/hardware-configuration.nix index b24bd7a..14a35e9 100644 --- a/hosts/spider/hardware-configuration.nix +++ b/hosts/spider/hardware-configuration.nix @@ -1,35 +1,38 @@ # 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, ... }: - { - imports = - [ (modulesPath + "/installer/scan/not-detected.nix") - ]; + config, + lib, + modulesPath, + ... +}: { + imports = [ + (modulesPath + "/installer/scan/not-detected.nix") + ]; - boot.initrd.availableKernelModules = [ "xhci_pci" "nvme" "usb_storage" "sd_mod" "rtsx_pci_sdmmc" ]; - boot.initrd.kernelModules = [ ]; - boot.kernelModules = [ "kvm-intel" ]; - boot.extraModulePackages = [ ]; + boot.initrd.availableKernelModules = ["xhci_pci" "nvme" "usb_storage" "sd_mod" "rtsx_pci_sdmmc"]; + boot.initrd.kernelModules = []; + boot.kernelModules = ["kvm-intel"]; + boot.extraModulePackages = []; - fileSystems."/" = - { device = "/dev/disk/by-uuid/951f8c69-070f-4e2c-9af9-b52e43a72577"; - fsType = "ext4"; - }; + fileSystems."/" = { + device = "/dev/disk/by-uuid/951f8c69-070f-4e2c-9af9-b52e43a72577"; + fsType = "ext4"; + }; - fileSystems."/boot" = - { device = "/dev/disk/by-uuid/BF5F-3F1E"; - fsType = "vfat"; - options = [ "fmask=0077" "dmask=0077" ]; - }; + fileSystems."/boot" = { + device = "/dev/disk/by-uuid/BF5F-3F1E"; + fsType = "vfat"; + options = ["fmask=0077" "dmask=0077"]; + }; - fileSystems."/home" = - { device = "/dev/disk/by-uuid/8bf53e75-628e-4a1b-a19f-1ac55be2af35"; - fsType = "ext4"; - }; + fileSystems."/home" = { + device = "/dev/disk/by-uuid/8bf53e75-628e-4a1b-a19f-1ac55be2af35"; + fsType = "ext4"; + }; - swapDevices = [ ]; + swapDevices = []; # 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/overlays/default.nix b/overlays/default.nix new file mode 100644 index 0000000..230a1d8 --- /dev/null +++ b/overlays/default.nix @@ -0,0 +1,30 @@ +{ + outputs, + inputs, +}: let + addPatches = pkg: patches: + pkg.overrideAttrs (oldAttrs: { + patches = (oldAttrs.patches or []) ++ patches; + }); +in { + # For every flake input, aliases 'pkgs.inputs.${flake}' to + # 'inputs.${flake}.packages.${pkgs.system}' or + # 'inputs.${flake}.legacyPackages.${pkgs.system}' + flake-inputs = final: _: { + inputs = + builtins.mapAttrs ( + _: flake: let + legacyPackages = (flake.legacyPackages or {}).${final.system} or {}; + packages = (flake.packages or {}).${final.system} or {}; + in + if legacyPackages != {} + then legacyPackages + else packages + ) + inputs; + }; + + nixpkgs.overlays = [ + nix-vscode-extensions.overlays.default + ]; +}