diff --git a/common/sops.nix b/common/sops.nix index 423fb28..df59122 100644 --- a/common/sops.nix +++ b/common/sops.nix @@ -8,7 +8,7 @@ inputs.sops-nix.nixosModules.sops ]; - sops = { + sops = { defaultSopsFile = ../secrets.yaml; validateSopsFiles = false; diff --git a/flake-mods/allowUnfree.nix b/flake-mods/allowUnfree.nix new file mode 100644 index 0000000..739e2da --- /dev/null +++ b/flake-mods/allowUnfree.nix @@ -0,0 +1,11 @@ +{inputs, ...}: { + perSystem = { system, ...}: { + _module.args.pkgs = import inputs.nixpkgs { + inherit system; + config.allowUnfree = true; + # The allowUnfreePredicate is due to home-manager#2942 (I haven't actually checked that it is necessary) + # https://github.com/nix-community/home-manager/issues/2942 + config.allowUnfreePredicate = (_: true); + }; + }; +} diff --git a/flake-mods/hm-flake-part.nix b/flake-mods/hm-flake-part.nix new file mode 100644 index 0000000..1a4a237 --- /dev/null +++ b/flake-mods/hm-flake-part.nix @@ -0,0 +1,21 @@ +{ lib, flake-parts-lib, ... }: +let + inherit (lib) + mkOption + types + ; + inherit (flake-parts-lib) + mkTransposedPerSystemModule + ; +in +mkTransposedPerSystemModule { + name = "homeConfigurations"; + option = mkOption { + type = types.raw; + default = { }; + description = '' + home-manager configs + ''; + }; + file = ./hm-flake-part.nix; +} diff --git a/flake-mods/hm.nix b/flake-mods/hm.nix new file mode 100644 index 0000000..6c102a4 --- /dev/null +++ b/flake-mods/hm.nix @@ -0,0 +1,28 @@ +{inputs, lib, ...}: { + imports = [ + ./hm-flake-part.nix + ]; + perSystem = { config, self', inputs', pkgs, system, ... }: let + # split system (e.g. x86_64-linux) into os and arch + splitSystem = lib.splitString "-" system; + os = builtins.elemAt splitSystem 0; + arch = builtins.elemAt splitSystem 1; + in { + legacyPackages.homeConfigurations.xqtc = inputs.home-manager.lib.homeManagerConfiguration { + inherit pkgs; + modules = [ + ../home + inputs.nixvim.homeManagerModules.nixvim + inputs.sops-nix.homeManagerModules.sops + { inherit os arch; } + ]; + extraSpecialArgs = {inherit inputs;}; + }; + + # # this sounds stupid, but it's the only way to make home-manager consume a + # # flake output with the system in it, which *should* be the case because it + # # wants system-specific pkgs, but flake-parts (rightfully so!) complains + # # that this isn't a package, so we do this to make both happy. + # packages.homeConfigurations.type = "derivation"; + }; +} diff --git a/flake-mods/nixosHosts.nix b/flake-mods/nixosHosts.nix new file mode 100644 index 0000000..f37e48e --- /dev/null +++ b/flake-mods/nixosHosts.nix @@ -0,0 +1,11 @@ +{inputs, lib, ...}: { + flake = lib.genAttrs [ + "asmodeus" "seraphim" "lilith" "lambda" "beleth" + ] (name: inputs.nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + modules = [ + ../hosts/x86_64-linux/${name} + ]; + specialArgs = {inherit inputs;}; + }); +} diff --git a/flake.lock b/flake.lock index efccbfa..e2be8d7 100644 --- a/flake.lock +++ b/flake.lock @@ -164,6 +164,24 @@ } }, "flake-parts": { + "inputs": { + "nixpkgs-lib": "nixpkgs-lib" + }, + "locked": { + "lastModified": 1727826117, + "narHash": "sha256-K5ZLCyfO/Zj9mPFldf3iwS6oZStJcU4tSpiXTMYaaL0=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "3d04084d54bedc3d6b8b736c70ef449225c361b1", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, + "flake-parts_2": { "inputs": { "nixpkgs-lib": [ "nixvim", @@ -558,6 +576,18 @@ "type": "github" } }, + "nixpkgs-lib": { + "locked": { + "lastModified": 1727825735, + "narHash": "sha256-0xHYkMkeLVQAMa7gvkddbPqpxph+hDzdu1XdGPJR+Os=", + "type": "tarball", + "url": "https://github.com/NixOS/nixpkgs/archive/fb192fec7cc7a4c26d51779e9bab07ce6fa5597a.tar.gz" + }, + "original": { + "type": "tarball", + "url": "https://github.com/NixOS/nixpkgs/archive/fb192fec7cc7a4c26d51779e9bab07ce6fa5597a.tar.gz" + } + }, "nixpkgs-master": { "locked": { "lastModified": 1727111026, @@ -720,7 +750,7 @@ "inputs": { "devshell": "devshell", "flake-compat": "flake-compat_2", - "flake-parts": "flake-parts", + "flake-parts": "flake-parts_2", "git-hooks": "git-hooks", "home-manager": "home-manager_2", "nix-darwin": "nix-darwin", @@ -816,6 +846,7 @@ "compose2nix": "compose2nix", "dwl-source": "dwl-source", "firefox-addons": "firefox-addons", + "flake-parts": "flake-parts", "flake-utils": "flake-utils_3", "home-manager": "home-manager", "lix-module": "lix-module", diff --git a/flake.nix b/flake.nix index 52899ae..82fe77b 100644 --- a/flake.nix +++ b/flake.nix @@ -6,6 +6,7 @@ nixos-aarch64-widevine.url = "github:epetousis/nixos-aarch64-widevine"; nixpkgs-master.url = "github:NixOS/nixpkgs/master"; apple-silicon.url = "github:tpwrules/nixos-apple-silicon"; + flake-parts.url = "github:hercules-ci/flake-parts"; compose2nix = { url = "github:aksiksi/compose2nix"; inputs.nixpkgs.follows = "nixpkgs"; @@ -41,78 +42,14 @@ }; #inputs.agenix.url = "github:ryantm/agenix"; - outputs = inputs @ { - self, - nixpkgs, - nixpkgs-master, - firefox-addons, - home-manager, - proxmox-nixos, - nixos-hardware, - nixvim, - nh, - lix-module, - dwl-source, - sops-nix, - ... - }: let - lib = nixpkgs.lib; - util = (import ./overlays/util.nix {} {}).util; - system = "x86_64-linux"; - in { - nixosConfigurations = { - "asmodeus" = lib.nixosSystem rec { - system = "x86_64-linux"; - modules = [ - ./hosts/x86_64-linux/asmodeus - ]; - specialArgs = {inherit inputs;}; - }; - "seraphim" = lib.nixosSystem { - system = "x86_64-linux"; - modules = [./hosts/x86_64-linux/seraphim]; - specialArgs = {inherit inputs;}; - }; - "lilith" = lib.nixosSystem { - system = "x86_64-linux"; - modules = [./hosts/x86_64-linux/lilith]; - specialArgs = {inherit inputs;}; - }; - "lambda" = lib.nixosSystem { - system = "x86_64-linux"; - modules = [./hosts/x86_64-linux/lambda]; - specialArgs = {inherit inputs;}; - }; - "beleth" = lib.nixosSystem { - system = "x86_64-linux"; - modules = [ - ./hosts/x86_64-linux/beleth - proxmox-nixos.nixosModules.proxmox-ve - - ({ - pkgs, - lib, - ... - }: { - services.proxmox-ve.enable = false; - nixpkgs.overlays = [ - proxmox-nixos.overlays.${system} - ]; - services.openssh.settings.AcceptEnv = lib.mkForce "GIT_PROTOCOL LANG LC_*"; - }) - ]; - specialArgs = {inherit inputs;}; - }; - "alastor" = lib.nixosSystem { - system = "aarch64-linux"; - modules = [./hosts/aarch64-linux/alastor {nixpkgs.overlays = [inputs.nixos-aarch64-widevine.overlays.default];}]; - specialArgs = {inherit inputs;}; - }; + outputs = inputs@{ flake-parts, ... }: flake-parts.lib.mkFlake { inherit inputs; } { + imports = [ + ./flake-mods/hm.nix + ./flake-mods/nixosHosts.nix + ./flake-mods/allowUnfree.nix + ]; + systems = [ "x86_64-linux" "aarch64-linux" "aarch64-darwin" "x86_64-darwin" ]; + perSystem = { config, self', inputs', pkgs, system, ... }: {}; + flake = {}; }; - - formatter = { - x86_64-linux = inputs.nixpkgs.legacyPackages.x86_64-linux.alejandra; - aarch64-linux = inputs.nixpkgs.legacyPackages.aarch64-linux.alejandra; - }; - }; } diff --git a/home/config-files/maxfetch.sh b/home/config-files/maxfetch.sh index aaa5887..0c5fa42 100755 --- a/home/config-files/maxfetch.sh +++ b/home/config-files/maxfetch.sh @@ -1,8 +1,8 @@ #!/usr/bin/env bash -unicode=" " +unicode=" " version="1.2.0" - + _black=$(tput setaf 0) red=$(tput setaf 1) green=$(tput setaf 2) @@ -29,7 +29,7 @@ up=$(uptime | awk -F'( |,|:)+' '{ up=$(sed -e "s/ h/h/g" <<< ${up}) up=$(sed -e "s/ m/m/g" <<< ${up}) -pkgs=$(nix-store --query --requisites /run/current-system | wc -l) +pkgs=$(nix-store --query --requisites /run/current-system 2>/dev/null | wc -l) arch=$(nix-instantiate --eval -E 'builtins.currentSystem') arch_sanitized=$(echo $arch | sed 's/^"//;s/"$//') @@ -39,7 +39,7 @@ fetch() { # echo "${cyan}$(tput bold) / |/ (_)_ __/ __ \/ __/ ${normal}$(tput sgr0)" # echo "${cyan}$(tput bold) / / /\ \ / /_/ /\ \ ${normal}$(tput sgr0)" # echo "${cyan}$(tput bold) /_/|_/_//_\_"'\\'"____/___/ ${normal}$(tput sgr0)" - # echo "${cyan}$(tput bold)⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣀⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀${normal}$(tput sgr0)" + # echo "${cyan}$(tput bold)⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣀⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀${normal}$(tput sgr0)" # echo "${cyan}$(tput bold)⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣰⠞⠛⣦⠎⠁⠹⣆⣤⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀${normal}$(tput sgr0)" # echo "${cyan}$(tput bold)⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣠⣄⣿⠀⠀⢸⠀⠀⢰⡏⢀⠿⢦⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀${normal}$(tput sgr0)" # echo "${cyan}$(tput bold)⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣾⠁⠘⣿⡀⢀⣸⠀⡴⠋⠻⡏⠀⢘⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀${normal}$(tput sgr0)" @@ -93,7 +93,7 @@ fetch() { # echo "${cyan}$(tput bold)⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠘⣿⣿⣿⣿⣿⣿⠏⠙⠋⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀${normal}$(tput sgr0)" # echo "${cyan}$(tput bold)⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠉⠙⠛⠉⠉⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀${normal}$(tput sgr0)" # if [[ $(($RANDOM % 2)) == 0 ]]; then - # echo "${cyan}$(tput bold)⠀⠀⠀⠀⠀⠀⠀⠙⣿⣷⣄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ ${normal}$(tput sgr0)" + # echo "${cyan}$(tput bold)⠀⠀⠀⠀⠀⠀⠀⠙⣿⣷⣄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ ${normal}$(tput sgr0)" # echo "${cyan}$(tput bold)⠀⠀⠀⠀⠀⠀⠀⠀⢺⣿⣿⡆⠀⠀⠀⠀⠀⠀⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀${normal}$(tput sgr0)" # echo "${cyan}$(tput bold)⠀⠀⠀⠀⠀⠀⠀⠀⢸⣿⣿⡇⠀⠀⠀⠀⠀⠀⣾⢡⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢢⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀${normal}$(tput sgr0)" # echo "${cyan}$(tput bold)⠀⠀⠀⠀⠀⠀⠀⠀⠈⣿⣿⣷⡦⠀⠀⠀⠀⢰⣿⣿⣷⠀⠀⠀⠀⠀⠀⠀⠀⠃⣠⣾⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀${normal}$(tput sgr0)" @@ -120,14 +120,14 @@ fetch() { # echo "${cyan}$(tput bold)⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ ${normal}$(tput sgr0)" # echo "${cyan}$(tput bold) meow! ${normal}$(tput sgr0)" # else - # echo "${cyan}$(tput bold) _ へ ╱|、 ${normal}$(tput sgr0)" - # echo "${cyan}$(tput bold) ૮ - ՛ ) つ(> < 7 ${normal}$(tput sgr0)" - # echo "${cyan}$(tput bold) / ⁻ ៸ 、˜〵${normal}$(tput sgr0)" - # echo "${cyan}$(tput bold) 乀 (ˍ, ل じしˍ,)ノ${normal}$(tput sgr0)" + # echo "${cyan}$(tput bold) _ へ ╱|、 ${normal}$(tput sgr0)" + # echo "${cyan}$(tput bold) ૮ - ՛ ) つ(> < 7 ${normal}$(tput sgr0)" + # echo "${cyan}$(tput bold) / ⁻ ៸ 、˜〵${normal}$(tput sgr0)" + # echo "${cyan}$(tput bold) 乀 (ˍ, ل じしˍ,)ノ${normal}$(tput sgr0)" echo "" echo " ╭─────────────╮ " echo " │ ${red} ${normal} user │ ${red}$(whoami)${normal}" - echo " │ ${yellow} ${normal} distro │ ${yellow}$(sed -nE "s@PRETTY_NAME=\"([^\"]*)\"@\1@p" /etc/os-release)${normal} " + echo " │ ${yellow} ${normal} distro │ ${yellow}$(sed -nE "s@PRETTY_NAME=\"([^\"]*)\"@\1@p" /etc/os-release 2>/dev/null || echo "MacOS")${normal} " echo " │ ${green} ${normal} kernel │ ${green}$(uname -r)${normal} " echo " │ ${cyan}󱂬 ${normal} de/wm │ ${cyan}$XDG_CURRENT_DESKTOP${normal} " echo " │ ${blue} ${normal} uptime │ ${blue}${up}${normal} " diff --git a/home/config-files/nvim/init.lua b/home/config-files/nvim/init.lua index 664ff84..bb05c6e 100644 --- a/home/config-files/nvim/init.lua +++ b/home/config-files/nvim/init.lua @@ -3,6 +3,10 @@ vim.keymap.set("n", "", "l") vim.keymap.set("n", "", "h") vim.keymap.set("n", "", "k") vim.keymap.set("n", "", "j") +vim.keymap.set("n", "", "l") +vim.keymap.set("n", "", "h") +vim.keymap.set("n", "", "k") +vim.keymap.set("n", "", "j") -- Escape for exiting terminal mode vim.keymap.set('t', '', '') diff --git a/home/default.nix b/home/default.nix index 9f424c1..74ff029 100644 --- a/home/default.nix +++ b/home/default.nix @@ -7,9 +7,10 @@ }: { imports = [ ./modules + ./system.nix ]; home.username = "xqtc"; - home.homeDirectory = "/home/xqtc"; + home.homeDirectory = if config.os == "linux" then "/home/xqtc" else "/Users/xqtc"; programs.wezterm = { enable = true; @@ -18,7 +19,7 @@ programs.joshuto = {enable = true;}; - dconf.enable = true; + dconf.enable = config.os == "linux"; services.easyeffects = lib.mkIf (pkgs.system == "x86_64-linux") {enable = true;}; diff --git a/home/modules/default.nix b/home/modules/default.nix index 61e141e..3d9bd19 100644 --- a/home/modules/default.nix +++ b/home/modules/default.nix @@ -22,6 +22,6 @@ ./zoxide.nix ./sops.nix ./spotify-cli.nix - # ./ssh.nix + ./ssh.nix ]; } diff --git a/home/modules/firefox.nix b/home/modules/firefox.nix index 2ac2c64..3814f8d 100644 --- a/home/modules/firefox.nix +++ b/home/modules/firefox.nix @@ -3,12 +3,13 @@ outputs, config, pkgs, + lib, ... }: with inputs; { - home.sessionVariables.DEFAULT_BROWSER = "${pkgs.firefox}/bin/firefox"; + home.sessionVariables.DEFAULT_BROWSER = if (config.os == "linux") then "${pkgs.firefox}/bin/firefox" else "firefox"; - programs.firefox = { + programs.firefox = lib.mkIf (config.os == "linux") { enable = true; package = pkgs.firefox.override {cfg = {enableGnomeExtensions = true;};}; diff --git a/home/modules/foot.nix b/home/modules/foot.nix index 003fadd..247f960 100644 --- a/home/modules/foot.nix +++ b/home/modules/foot.nix @@ -4,7 +4,7 @@ ... }: { programs.foot = { - enable = true; + enable = config.os == "linux"; settings = { main = { font = "ComicShannsMono Nerd Font Mono:size=11"; diff --git a/home/modules/gtk.nix b/home/modules/gtk.nix index 39070fc..66dda6e 100644 --- a/home/modules/gtk.nix +++ b/home/modules/gtk.nix @@ -2,6 +2,7 @@ config, pkgs, inputs, + lib, ... }: { dconf.settings = { @@ -52,7 +53,7 @@ ''; }; }; - home.packages = with pkgs; [ + home.packages = lib.optionals (config.os == "linux") (with pkgs; [ gnomeExtensions.user-themes gnomeExtensions.blur-my-shell gnomeExtensions.tray-icons-reloaded @@ -63,7 +64,7 @@ gnomeExtensions.burn-my-windows gnomeExtensions.desktop-cube catppuccin-cursors.mochaPink - ]; + ]); # home.pointerCursor = { # gtk.enable = true; # x11.enable = true; diff --git a/home/modules/home-pkgs.nix b/home/modules/home-pkgs.nix index 57199ad..438b8c6 100644 --- a/home/modules/home-pkgs.nix +++ b/home/modules/home-pkgs.nix @@ -2,131 +2,126 @@ config, inputs, pkgs, + lib, ... }: let flameshot = pkgs.flameshot.overrideDerivation (old: {NIX_CFLAGS_COMPILE = "-DUSE_WAYLAND_GRIM";}); - x86pkgs = - if pkgs.system == "x86_64-linux" - then [ - pkgs.steam - pkgs.heroic - pkgs.protonup-qt - pkgs.via - pkgs.telegram-desktop - pkgs.jetbrains.rust-rover - pkgs.tutanota-desktop - pkgs.bitwarden-desktop - pkgs.bottles - flameshot - pkgs.grim - # pkgs.ida-free - # pkgs.spotify - ] - else []; - maxfetch = pkgs.writeScriptBin "maxfetch" (builtins.readFile ../config-files/maxfetch.sh); startdwl = pkgs.writeScriptBin "startdwl" (builtins.readFile ../config-files/startdwl.sh); in { - home.packages = - [ - pkgs.yubioath-flutter + home.packages = (lib.optionals (config.os == "linux") (with pkgs; [ + yubioath-flutter + steam + heroic + protonup-qt + via + telegram-desktop + jetbrains.rust-rover + tutanota-desktop + bitwarden-desktop + bottles + flameshot + grim + networkmanagerapplet + nextcloud-client + swaylock-effects + wdisplays + brightnessctl + pavucontrol + swayfx + sway-contrib.grimshot + libnotify + swww + strace + ltrace + ghidra + imhex + qmk-udev-rules + jellyfin-media-player + signal-desktop + # ida-free + # spotify + ])) ++ (with pkgs; [ + nh - pkgs.ncspot + ncspot - pkgs.wakatime-cli + wakatime-cli - pkgs.neofetch - # pkgs.uwufetch - maxfetch - startdwl - pkgs.btop - pkgs.iftop - pkgs.ranger + neofetch + # uwufetch + maxfetch + startdwl + btop + iftop + ranger - pkgs.cargo-mommy - pkgs.evcxr + cargo-mommy - pkgs.just - pkgs.fzf + just + fzf - pkgs.catppuccin-kde + catppuccin-kde - pkgs.typst + typst - pkgs.networkmanagerapplet + # marked as broken + # anki - pkgs.anki + freetube - pkgs.freetube + openvpn - pkgs.openvpn + moodle-dl - pkgs.moodle-dl - pkgs.nextcloud-client + obsidian - pkgs.obsidian - pkgs.swaylock-effects - pkgs.wdisplays - pkgs.prismlauncher + prismlauncher - pkgs.syncthingtray + # marked as broken + # syncthingtray - pkgs.brightnessctl - pkgs.pavucontrol - pkgs.rbw + rbw - pkgs.swayfx - pkgs.sway-contrib.grimshot - pkgs.libnotify + nodejs - pkgs.strace - pkgs.ltrace + # cabal + ghc - pkgs.nodejs + # marked as broken + # rizin + # (cutter.withPlugins (ps: with ps; [jsdec rz-ghidra sigdb])) - # pkgs.cabal - pkgs.ghc - pkgs.rizin - (pkgs.cutter.withPlugins (ps: with ps; [jsdec rz-ghidra sigdb])) + nerdfonts + ipafont - pkgs.imhex - pkgs.ghidra + vesktop + element-desktop - pkgs.nerdfonts - pkgs.ipafont + qbittorrent + nicotine-plus - pkgs.signal-desktop - pkgs.vesktop - pkgs.element-desktop + qmk - pkgs.qbittorrent - pkgs.nicotine-plus + neovide - pkgs.qmk - pkgs.qmk-udev-rules + xournalpp + zathura - pkgs.neovide + ripgrep - pkgs.xournalpp - pkgs.zathura + sayonara + # mpv + feishin - pkgs.ripgrep + nix-tree - pkgs.sayonara - pkgs.mpv - pkgs.jellyfin-media-player - pkgs.feishin - - pkgs.nix-tree - - pkgs.nixos-icons - pkgs.swww - ] - ++ x86pkgs; + nixos-icons + ]); } diff --git a/home/modules/nixvim.nix b/home/modules/nixvim.nix index 5a1ec32..4b7b2d2 100644 --- a/home/modules/nixvim.nix +++ b/home/modules/nixvim.nix @@ -20,7 +20,7 @@ clipboard.providers.wl-copy.enable = true; - options = { + opts = { number = true; # Show line numbers relativenumber = true; # Show relative line numbers @@ -47,22 +47,22 @@ wakatime.enable = true; headlines.enable = true; twilight.enable = true; - comment-nvim = { + comment = { enable = true; }; indent-blankline.enable = true; lualine = { enable = true; - disabledFiletypes.statusline = ["neo-tree"]; - componentSeparators = { - left = ""; - right = ""; - }; - sectionSeparators = { - left = ""; - right = ""; - }; settings = { + disabled_filetypes.statusline = ["neo-tree"]; + component_separators = { + left = ""; + right = ""; + }; + section_separators = { + left = ""; + right = ""; + }; sections = { lualine_y = [ { @@ -153,9 +153,7 @@ # port = "31337"; # host = "127.0.0.1"; # }; - }; - server = { - settings = { + server.settings = { inlayHints = { closureStyle = "rust_analyzer"; }; @@ -179,7 +177,7 @@ nushell.enable = true; clangd.enable = true; svelte.enable = true; - tsserver.enable = true; + ts-ls.enable = true; java-language-server.enable = true; hls.enable = true; eslint.enable = true; @@ -194,7 +192,7 @@ typing.autoClosingAngleBrackets.enable = true; }; }; - nil_ls.enable = true; + nil-ls.enable = true; }; }; dap = { @@ -210,12 +208,12 @@ treesitter = { enable = true; folding = true; - indent = true; nixvimInjections = true; settings = { ensure_installed = "all"; # highlight.enable = true; highlight.enable = true; + indent.enable = true; }; }; treesitter-refactor = { @@ -269,6 +267,7 @@ }; }; telescope.enable = true; + web-devicons.enable = true; # required by telescope telescope.extensions = {file-browser.enable = true;}; which-key.enable = true; cmp-nvim-lsp.enable = true; @@ -285,7 +284,6 @@ enable = true; theme = null; - iconsEnabled = true; layout = [ { type = "padding"; diff --git a/home/modules/rofi.nix b/home/modules/rofi.nix index b3f3c93..4d108b4 100644 --- a/home/modules/rofi.nix +++ b/home/modules/rofi.nix @@ -6,7 +6,7 @@ ... }: { programs.rbw = { - enable = true; + enable = config.os == "linux"; settings = { email = "xqtc@tutanota.com"; lock_timeout = 300; @@ -14,7 +14,7 @@ }; }; programs.rofi = { - enable = true; + enable = config.os == "linux"; package = pkgs.rofi-wayland; plugins = [pkgs.rofi-rbw-wayland pkgs.rofi-power-menu]; extraConfig = { diff --git a/home/modules/shell.nix b/home/modules/shell.nix index 3128318..107830f 100644 --- a/home/modules/shell.nix +++ b/home/modules/shell.nix @@ -5,7 +5,7 @@ ... }: { programs = { - zsh.enable = true; + zsh.enable = if config.os == "linux" then true else false; atuin = { enable = true; enableNushellIntegration = true; diff --git a/home/modules/sops.nix b/home/modules/sops.nix index 868a008..f46dd75 100644 --- a/home/modules/sops.nix +++ b/home/modules/sops.nix @@ -10,7 +10,7 @@ age = { sshKeyPaths = ["/etc/ssh/ssh_host_ed25519_key"]; - keyFile = "/home/xqtc/.config/sops/age/keys.txt"; + keyFile = if (config.os == "linux") then "/home/xqtc/.config/sops/age/keys.txt" else "/Users/xqtc/.config/sops/age/keys.txt"; generateKey = true; }; }; diff --git a/home/modules/spotify-cli.nix b/home/modules/spotify-cli.nix index 96e12e4..a830403 100644 --- a/home/modules/spotify-cli.nix +++ b/home/modules/spotify-cli.nix @@ -5,14 +5,14 @@ inputs, ... }: { - services.spotifyd.enable = true; + services.spotifyd.enable = config.os == "linux"; services.spotifyd.settings.global = { bitrate = 320; username = "xqtc@tutanota.com"; password_cmd = "cat /etc/spotifyd_pw"; }; - sops.secrets = { + sops.secrets = lib.mkIf (config.os == "linux") { "spotify/password" = { path = "/etc/spotifyd_pw"; }; diff --git a/home/modules/ssh.nix b/home/modules/ssh.nix index f648815..d47997d 100644 --- a/home/modules/ssh.nix +++ b/home/modules/ssh.nix @@ -5,16 +5,28 @@ pkgs, ... }: { - sops.secrets = { - "private_keys/xqtc" = { - path = "/home/xqtc/.ssh/id_ed25519"; + sops = { + # defaultSopsFile = ../secrets.yaml; + # validateSopsFiles = false; + # + # age = { + # sshKeyPaths = ["/etc/ssh/ssh_host_ed25519_key"]; + # keyFile = "/var/lib/sops/age/keys.txt"; + # generateKey = true; + # }; + secrets = { + "xqtc_private" = { + # path = if (pkgs.system == "aarch64-darwin") then "/Users/xqtc/.ssh/id_ed25519" else "/home/xqtc/.ssh/id_ed25519"; + path = config.home.homeDirectory + "/.ssh/id_ed25519"; # owner = "xqtc"; mode = "600"; }; - "public_keys/xqtc" = { - path = "/home/xqtc/.ssh/id_ed25519.pub"; + "xqtc_public" = { + # path = if (pkgs.system == "aarch64-darwin") then "/Users/xqtc/.ssh/id_ed25519.pub" else "/home/xqtc/.ssh/id_ed25519.pub"; + path = config.home.homeDirectory + "/.ssh/id_ed25519.pub"; # owner = "xqtc"; mode = "640"; }; }; + }; } diff --git a/home/modules/wm.nix b/home/modules/wm.nix index 781e3dd..85d85f8 100644 --- a/home/modules/wm.nix +++ b/home/modules/wm.nix @@ -6,7 +6,7 @@ ... }: { wayland.windowManager.hyprland = { - enable = true; + enable = config.os == "linux"; package = pkgs.hyprland; #xwayland.enable = true; @@ -20,7 +20,7 @@ lib.mkIf (pkgs.system == "x86_64-linux") */ { - enable = true; + enable = config.os == "linux"; settings = { mainBar = { layer = "top"; @@ -113,7 +113,7 @@ }; services.mako = { - enable = true; + enable = config.os == "linux"; font = "ComicShannsMono Nerd Font Mono 15"; backgroundColor = "#1e1e2e"; textColor = "#cdd6f4"; diff --git a/home/system.nix b/home/system.nix new file mode 100644 index 0000000..55009d7 --- /dev/null +++ b/home/system.nix @@ -0,0 +1,10 @@ +{lib, ...}: { + options.os = lib.mkOption { + type = lib.types.str; + default = "linux"; + }; + options.arch = lib.mkOption { + type = lib.types.str; + default = "x86_64"; + }; +} diff --git a/justfile b/justfile index 0c2577d..4d516b6 100644 --- a/justfile +++ b/justfile @@ -27,6 +27,11 @@ beleth: # fi # @echo "Host arch needs to be 'x86_64-linux'! Aborting..."; +beleth-non-nixos: + set -euxo pipefail + ssh {{beleth-user-host}} "cd nixos-config && git pull && nixos-rebuild --flake . switch && echo meow" + ssh {{beleth-user-host}} "cd && cd /var/www/cheats-rs/ && git pull && zola build && cd && sh build_website.sh"; + website: #!/usr/bin/env bash set -euxo pipefail diff --git a/result b/result new file mode 120000 index 0000000..2769881 --- /dev/null +++ b/result @@ -0,0 +1 @@ +/nix/store/7nlb2hg141qvsbychf5kd0pqb49yp579-home-manager-generation \ No newline at end of file diff --git a/tmp.txt b/tmp.txt new file mode 100644 index 0000000..2d1f76a --- /dev/null +++ b/tmp.txt @@ -0,0 +1 @@ +"signal-desktop" "vesktop" "element-desktop" "qbittorrent" "nicotine-plus" "qmk" "qmk-udev-rules" "neovide" "xournalpp" "zathura" "ripgrep" "sayonara" "mpv" "jellyfin-media-player" "feishin" "nix-tree" "nixos-icons"