From 5d5ca6ef1c66aadbcb20c0cd520aff0b73774200 Mon Sep 17 00:00:00 2001 From: ChaotiCryptidz Date: Sun, 26 Dec 2021 14:07:09 +0000 Subject: [PATCH] a lot of shuffling things around --- flake.nix | 1 - home/base/zsh.nix | 2 +- {profiles => home}/dev/archives.nix | 4 +- home/dev/git.nix | 6 +- home/gaming/gaming.nix | 12 + home/{vscode => programming}/code.nix | 7 - home/programming/languages/go/go.nix | 6 + home/programming/languages/nix/nix.nix | 14 ++ home/programming/languages/zig/zig.nix | 6 + .../dev => home/reversing}/reversing.nix | 3 +- home/sway/sway.nix | 229 +++++++++--------- hosts/default.nix | 13 +- hosts/lappy.nix | 14 +- outputs.nix | 4 +- overlay/comic-code/default.nix | 6 +- overlay/gobar/default.nix | 3 +- overlay/zar/default.nix | 3 +- profiles/base/access.nix | 4 - profiles/base/home.nix | 3 +- profiles/base/nix.nix | 19 +- profiles/base/programs.nix | 4 +- profiles/base/services.nix | 4 +- profiles/dev/debugging.nix | 7 +- profiles/dev/editors.nix | 6 +- profiles/dev/extra.nix | 9 +- profiles/dev/info.nix | 6 +- profiles/dev/programming.nix | 14 -- profiles/dev/vcs.nix | 6 +- profiles/gaming/gaming.nix | 10 - profiles/gui/default.nix | 5 +- profiles/network_manager/nm.nix | 4 +- profiles/pulse/default.nix | 8 +- profiles/sway/sway.nix | 4 +- tree.nix | 171 +++++++------ users/chaoticryptidz/chaoticryptidz.nix | 3 +- 35 files changed, 282 insertions(+), 338 deletions(-) rename {profiles => home}/dev/archives.nix (74%) create mode 100644 home/gaming/gaming.nix rename home/{vscode => programming}/code.nix (65%) create mode 100644 home/programming/languages/go/go.nix create mode 100644 home/programming/languages/nix/nix.nix create mode 100644 home/programming/languages/zig/zig.nix rename {profiles/dev => home/reversing}/reversing.nix (64%) delete mode 100644 profiles/dev/programming.nix diff --git a/flake.nix b/flake.nix index fce426b..1e82589 100644 --- a/flake.nix +++ b/flake.nix @@ -7,6 +7,5 @@ deploy-rs.url = "github:serokell/deploy-rs"; }; - outputs = { ... }@inputs: import ./outputs.nix inputs; } diff --git a/home/base/zsh.nix b/home/base/zsh.nix index 8d122da..61ba7af 100644 --- a/home/base/zsh.nix +++ b/home/base/zsh.nix @@ -1,7 +1,7 @@ { ... }: { programs.zsh = { enable = true; - ohMyZsh = { + oh-my-zsh = { enable = true; theme = "afowler"; plugins = [ ]; diff --git a/profiles/dev/archives.nix b/home/dev/archives.nix similarity index 74% rename from profiles/dev/archives.nix rename to home/dev/archives.nix index 18e5373..783993b 100644 --- a/profiles/dev/archives.nix +++ b/home/dev/archives.nix @@ -1,5 +1,5 @@ { pkgs, ... }: { - environment.systemPackages = with pkgs; [ + home.packages = with pkgs; [ zip unzip p7zip @@ -12,6 +12,6 @@ bzip2 squashfsTools cpio - lz4 + lz4 ]; } diff --git a/home/dev/git.nix b/home/dev/git.nix index 032a3fe..2927af0 100644 --- a/home/dev/git.nix +++ b/home/dev/git.nix @@ -4,10 +4,6 @@ package = pkgs.gitAndTools.gitFull; userName = "ChaotiCryptidz"; userEmail = "chaoticryptidz@owo.monster"; - extraConfig = { - credential = { - helper = "store"; - }; - }; + extraConfig = { credential = { helper = "store"; }; }; }; } diff --git a/home/gaming/gaming.nix b/home/gaming/gaming.nix new file mode 100644 index 0000000..c12df6e --- /dev/null +++ b/home/gaming/gaming.nix @@ -0,0 +1,12 @@ +{ config, pkgs, ... }: { + home.packages = with pkgs; [ + steam + lutris + mgba + nestopia + snes9x-gtk + melonDS + sixpair + xboxdrv + ]; +} diff --git a/home/vscode/code.nix b/home/programming/code.nix similarity index 65% rename from home/vscode/code.nix rename to home/programming/code.nix index a84132d..4dab0a3 100644 --- a/home/vscode/code.nix +++ b/home/programming/code.nix @@ -3,12 +3,6 @@ { programs.vscode = { enable = true; - extensions = with pkgs; [ - vscode-extensions.bbenoist.nix - vscode-extensions.brettm12345.nixfmt-vscode - vscode-extensions.tiehuis.zig - vscode-extensions.golang.go - ]; userSettings = { "window.zoomLevel" = -1; "editor.fontSize" = 24; @@ -19,7 +13,6 @@ "markdown.preview.fontFamily" = "'Comic Code'"; "terminal.integrated.fontFamily" = "'Comic Code'"; "files.autoSave" = "afterDelay"; - "[nix]" = { "editor.defaultFormatter" = "brettm12345.nixfmt-vscode"; }; }; }; } diff --git a/home/programming/languages/go/go.nix b/home/programming/languages/go/go.nix new file mode 100644 index 0000000..dc0f7ab --- /dev/null +++ b/home/programming/languages/go/go.nix @@ -0,0 +1,6 @@ +{ config, pkgs, ... }: + +{ + home.packages = with pkgs; [ go gopls go-outline goimports ]; + programs.vscode.extensions = with pkgs; [ vscode-extensions.golang.go ]; +} diff --git a/home/programming/languages/nix/nix.nix b/home/programming/languages/nix/nix.nix new file mode 100644 index 0000000..1fbd211 --- /dev/null +++ b/home/programming/languages/nix/nix.nix @@ -0,0 +1,14 @@ +{ config, pkgs, ... }: + +{ + home.packages = with pkgs; [ nixfmt ]; + + programs.vscode.extensions = with pkgs; [ + vscode-extensions.bbenoist.nix + vscode-extensions.brettm12345.nixfmt-vscode + ]; + + programs.vscode.userSettings."[nix]" = { + "editor.defaultFormatter" = "brettm12345.nixfmt-vscode"; + }; +} diff --git a/home/programming/languages/zig/zig.nix b/home/programming/languages/zig/zig.nix new file mode 100644 index 0000000..04f1891 --- /dev/null +++ b/home/programming/languages/zig/zig.nix @@ -0,0 +1,6 @@ +{ config, pkgs, ... }: + +{ + home.packages = with pkgs; [ zig zls ]; + programs.vscode.extensions = with pkgs; [ vscode-extensions.tiehuis.zig ]; +} diff --git a/profiles/dev/reversing.nix b/home/reversing/reversing.nix similarity index 64% rename from profiles/dev/reversing.nix rename to home/reversing/reversing.nix index a70a9ad..0c623ee 100644 --- a/profiles/dev/reversing.nix +++ b/home/reversing/reversing.nix @@ -1,9 +1,8 @@ { pkgs, ... }: { - environment.systemPackages = with pkgs; [ + home.packages = with pkgs; [ binwalk file binutils # strings diffoscope ]; - } diff --git a/home/sway/sway.nix b/home/sway/sway.nix index 2546182..bbe87b9 100644 --- a/home/sway/sway.nix +++ b/home/sway/sway.nix @@ -35,143 +35,130 @@ GPG_TTY \ NIX_PATH \ SHLVL - systemctl --user import-environment - #exec systemctl --user start sway.service exec env --unset=SHLVL systemd-cat -t sway -- sway fi ''; - -programs.waybar = { - enable = true; - # style = '' - # * { - # font-family: Iosevka; - # } - # ''; - settings = [{ + programs.waybar = { + enable = true; + settings = [{ position = "bottom"; - modules-left = [ ]; - modules-center = [ ]; - modules-right = [ "tray" ]; - }]; - }; + modules-left = [ ]; + modules-center = [ ]; + modules-right = [ "tray" ]; + }]; + }; wayland.windowManager.sway = { enable = true; wrapperFeatures.base = true; wrapperFeatures.gtk = true; - config = - let - terminal = "${pkgs.kitty}/bin/kitty"; - menu = "${pkgs.wofi}/bin/wofi -idbt ${pkgs.kitty}/bin/kitty -p '' -W 25%"; - cfg = config.wayland.windowManager.sway.config; - in - { - - - - bars = [ - { - position = "top"; - fonts = { - names = [ "Comic Code" ]; - size = 14.0; - }; - statusCommand = lib.escapeShellArgs [ - #"/home/chaoticryptidz/Projects/gobar/gobar " - "${pkgs.gobar}/bin/gobar" - "cpu\\|mem\\|weather\\(Leighton\\ Buzzard\\)\\|bat\\(BAT0\\)\\|time" - ]; - - } - { - command = "${pkgs.waybar}/bin/waybar"; - } - ]; - - input = { - "*" = { - xkb_layout = "gb"; + config = let + terminal = "${pkgs.kitty}/bin/kitty"; + menu = "${pkgs.wofi}/bin/wofi -idbt ${pkgs.kitty}/bin/kitty -p '' -W 25%"; + cfg = config.wayland.windowManager.sway.config; + in { + bars = [ + { + position = "top"; + fonts = { + names = [ "Comic Code" ]; + size = 14.0; }; - }; + statusCommand = lib.escapeShellArgs [ + #"/home/chaoticryptidz/Projects/gobar/gobar " + "${pkgs.gobar}/bin/gobar" + "cpu\\|mem\\|weather\\(Leighton\\ Buzzard\\)\\|bat\\(BAT0\\)\\|time" + ]; - fonts = { - names = [ "Comic Code" ]; - size = 18.0; - }; + } + { command = "${pkgs.waybar}/bin/waybar"; } + ]; - modifier = "Mod1"; - terminal = "${pkgs.kitty}/bin/kitty"; + input = { "*" = { xkb_layout = "gb"; }; }; - startup = [ - # gets blueman applet working for some reason - { command = "dbus-update-activation-environment DISPLAY"; always = true; } - { command = "nm-applet"; always = true; } - ]; - - seat = { - "*" = { - "xcursor_theme" = "Adwaita 24"; - }; - }; - - gaps = { - top = 10; - bottom = 10; - left = 10; - right = 10; - inner = 20; - outer = 20; - smartGaps = true; - }; - - window = { - border = 4; - titlebar = false; - }; - - keybindings = { - "${cfg.modifier}+Return" = "exec ${cfg.terminal}"; - - "${cfg.modifier}+Left" = "focus left"; - "${cfg.modifier}+Down" = "focus down"; - "${cfg.modifier}+Up" = "focus up"; - "${cfg.modifier}+Right" = "focus right"; - - "${cfg.modifier}+Shift+Left" = "move left"; - "${cfg.modifier}+Shift+Down" = "move down"; - "${cfg.modifier}+Shift+Up" = "move up"; - "${cfg.modifier}+Shift+Right" = "move right"; - - "${cfg.modifier}+Shift+space" = "floating toggle"; - "${cfg.modifier}+space" = "focus mode_toggle"; - - "XF86AudioRaiseVolume" = "exec pactl set-sink-volume $(pacmd list-sinks |awk '/* index:/{print $3}') +5%"; - "XF86AudioLowerVolume" = "exec pactl set-sink-volume $(pacmd list-sinks |awk '/* index:/{print $3}') -5%"; - "XF86AudioMute" = "exec pactl set-sink-mute $(pacmd list-sinks |awk '/* index:/{print $3}') toggle"; - "XF86AudioMicMute" = "exec pactl set-source-mute $(pacmd list-sources |awk '/* index:/{print $3}') toggle"; - "XF86MonBrightnessDown" = "exec ${pkgs.light}/bin/light -U 5"; - "XF86MonBrightnessUp" = "exec ${pkgs.light}/bin/light -A 5"; - "Print" = "exec ${pkgs.grim}/bin/grim -t png - | ${pkgs.wl-clipboard}/bin/wl-copy -t image/png"; - "Shift+Print" = "exec ${pkgs.grim}/bin/grim -t png -g \"$(${pkgs.slurp}/bin/slurp -d)\" - | ${pkgs.wl-clipboard}/bin/wl-copy -t image/png"; - - "${cfg.modifier}+d" = "exec ${cfg.menu}"; - "${cfg.modifier}+f" = "fullscreen"; - - "${cfg.modifier}+Shift+q" = "kill"; - "${cfg.modifier}+Shift+c" = "reload"; - - "${cfg.modifier}+r" = "mode resize"; - } // (lib.foldl lib.recursiveUpdate { } (map - (workspace: { - "${cfg.modifier}+${workspace}" = "workspace ${workspace}"; - "${cfg.modifier}+Shift+${workspace}" = "move container to workspace ${workspace}"; - }) [ "1" "2" "3" "4" "5" "6" "7" "8" "9" ])); + fonts = { + names = [ "Comic Code" ]; + size = 18.0; }; + + modifier = "Mod1"; + terminal = "${pkgs.kitty}/bin/kitty"; + + startup = [ + # gets blueman applet working for some reason + { + command = "dbus-update-activation-environment DISPLAY"; + always = true; + } + { + command = "nm-applet"; + always = true; + } + ]; + + seat = { "*" = { "xcursor_theme" = "Adwaita 24"; }; }; + + gaps = { + top = 10; + bottom = 10; + left = 10; + right = 10; + inner = 20; + outer = 20; + smartGaps = true; + }; + + window = { + border = 4; + titlebar = false; + }; + + keybindings = { + "${cfg.modifier}+Return" = "exec ${cfg.terminal}"; + + "${cfg.modifier}+Left" = "focus left"; + "${cfg.modifier}+Down" = "focus down"; + "${cfg.modifier}+Up" = "focus up"; + "${cfg.modifier}+Right" = "focus right"; + + "${cfg.modifier}+Shift+Left" = "move left"; + "${cfg.modifier}+Shift+Down" = "move down"; + "${cfg.modifier}+Shift+Up" = "move up"; + "${cfg.modifier}+Shift+Right" = "move right"; + + "${cfg.modifier}+Shift+space" = "floating toggle"; + "${cfg.modifier}+space" = "focus mode_toggle"; + + "XF86AudioRaiseVolume" = + "exec pactl set-sink-volume $(pacmd list-sinks |awk '/* index:/{print $3}') +5%"; + "XF86AudioLowerVolume" = + "exec pactl set-sink-volume $(pacmd list-sinks |awk '/* index:/{print $3}') -5%"; + "XF86AudioMute" = + "exec pactl set-sink-mute $(pacmd list-sinks |awk '/* index:/{print $3}') toggle"; + "XF86AudioMicMute" = + "exec pactl set-source-mute $(pacmd list-sources |awk '/* index:/{print $3}') toggle"; + "XF86MonBrightnessDown" = "exec ${pkgs.light}/bin/light -U 5"; + "XF86MonBrightnessUp" = "exec ${pkgs.light}/bin/light -A 5"; + "Print" = + "exec ${pkgs.grim}/bin/grim -t png - | ${pkgs.wl-clipboard}/bin/wl-copy -t image/png"; + "Shift+Print" = '' + exec ${pkgs.grim}/bin/grim -t png -g "$(${pkgs.slurp}/bin/slurp -d)" - | ${pkgs.wl-clipboard}/bin/wl-copy -t image/png''; + + "${cfg.modifier}+d" = "exec ${cfg.menu}"; + "${cfg.modifier}+f" = "fullscreen"; + + "${cfg.modifier}+Shift+q" = "kill"; + "${cfg.modifier}+Shift+c" = "reload"; + + "${cfg.modifier}+r" = "mode resize"; + } // (lib.foldl lib.recursiveUpdate { } (map (workspace: { + "${cfg.modifier}+${workspace}" = "workspace ${workspace}"; + "${cfg.modifier}+Shift+${workspace}" = + "move container to workspace ${workspace}"; + }) [ "1" "2" "3" "4" "5" "6" "7" "8" "9" ])); + }; }; } - - diff --git a/hosts/default.nix b/hosts/default.nix index 4d08f15..b1734d5 100644 --- a/hosts/default.nix +++ b/hosts/default.nix @@ -1,21 +1,16 @@ { home-manager, nixpkgs, tree, ... }@inputs: let - defaultModules = [ - home-manager.nixosModules.home-manager - tree.impure.profiles.base - ]; + defaultModules = + [ home-manager.nixosModules.home-manager tree.impure.profiles.base ]; defaultSpecialArgs = { tree = tree.impure; pureTree = tree.pure; inherit inputs; }; -in -{ +in { lappy = nixpkgs.lib.nixosSystem { specialArgs = defaultSpecialArgs; system = "x86_64-linux"; - modules = defaultModules ++ [ - ./lappy.nix - ]; + modules = defaultModules ++ [ ./lappy.nix ]; }; } diff --git a/hosts/lappy.nix b/hosts/lappy.nix index 7cd2597..013a4ac 100644 --- a/hosts/lappy.nix +++ b/hosts/lappy.nix @@ -15,18 +15,23 @@ profiles.gaming ]; + config.home-manager.users.root = { imports = with tree; [ home.base ]; }; + config.home-manager.users.chaoticryptidz = { imports = with tree; [ + home.base home.gui - home.dev + home.gaming home.dev home.network_manager home.sway - home.vscode + home.reversing + home.programming + home.programming.languages.go + home.programming.languages.nix ]; }; - config.networking.hostName = "lappy"; config.time.timeZone = "Europe/London"; config.powerManagement.cpuFreqGovernor = lib.mkDefault "powersave"; @@ -36,7 +41,8 @@ systemd-boot.enable = true; efi.canTouchEfiVariables = true; }; - initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usb_storage" "sd_mod" "rtsx_pci_sdmmc" ]; + initrd.availableKernelModules = + [ "xhci_pci" "ahci" "nvme" "usb_storage" "sd_mod" "rtsx_pci_sdmmc" ]; kernelModules = [ "kvm-intel" ]; }; diff --git a/outputs.nix b/outputs.nix index 76129a3..76fa4ad 100644 --- a/outputs.nix +++ b/outputs.nix @@ -8,10 +8,10 @@ let "profiles/*".functor.enable = true; "users/*".functor.enable = true; "home/*".functor.enable = true; + "home/programming/languages/*".functor.enable = true; }; }; -in -{ +in { legacyPackages.tree = tree; nixosConfigurations = import ./hosts { nixosSystem = nixpkgs.lib.nixosSystem; diff --git a/overlay/comic-code/default.nix b/overlay/comic-code/default.nix index bd41884..18a9cef 100644 --- a/overlay/comic-code/default.nix +++ b/overlay/comic-code/default.nix @@ -1,7 +1,9 @@ -{ fetchzip }: fetchzip { +{ fetchzip }: +fetchzip { name = "comic-code-1.0"; - url = "https://cdn.discordapp.com/attachments/780878889924165652/919700644347142214/COCOD.ZIP"; + url = + "https://cdn.discordapp.com/attachments/780878889924165652/919700644347142214/COCOD.ZIP"; sha256 = "sha256-MzEkMAopjpQBk24nRVDAtGNeF6f61XGww4rya2cU8TU="; postFetch = '' diff --git a/overlay/gobar/default.nix b/overlay/gobar/default.nix index 76a5c55..221db81 100644 --- a/overlay/gobar/default.nix +++ b/overlay/gobar/default.nix @@ -1,4 +1,5 @@ -{ stdenv, fetchFromGitLab, buildGoModule, lib, go }: buildGoModule rec { +{ stdenv, fetchFromGitLab, buildGoModule, lib, go }: +buildGoModule rec { pname = "gobar"; version = "latest-1"; diff --git a/overlay/zar/default.nix b/overlay/zar/default.nix index 9a875d4..9a264aa 100644 --- a/overlay/zar/default.nix +++ b/overlay/zar/default.nix @@ -1,4 +1,5 @@ -{ stdenv, fetchFromGitLab, lib, zig }: stdenv.mkDerivation rec { +{ stdenv, fetchFromGitLab, lib, zig }: +stdenv.mkDerivation rec { pname = "zar"; version = "latest-1"; diff --git a/profiles/base/access.nix b/profiles/base/access.nix index 135db3b..e6b07e4 100644 --- a/profiles/base/access.nix +++ b/profiles/base/access.nix @@ -1,8 +1,4 @@ { tree, config, lib, pkgs, ... }: { users.defaultUserShell = pkgs.zsh; security.sudo.wheelNeedsPassword = lib.mkForce false; - - imports = with tree; [ - home.base - ]; } diff --git a/profiles/base/home.nix b/profiles/base/home.nix index 18974db..2b22874 100644 --- a/profiles/base/home.nix +++ b/profiles/base/home.nix @@ -1,4 +1,5 @@ -{ inputs, tree, config, lib, ... }: with lib; { +{ inputs, tree, config, lib, ... }: +with lib; { options.home-manager.users = mkOption { type = types.attrsOf (types.submoduleWith { modules = [ ]; diff --git a/profiles/base/nix.nix b/profiles/base/nix.nix index 96be456..b5de65e 100644 --- a/profiles/base/nix.nix +++ b/profiles/base/nix.nix @@ -1,19 +1,14 @@ { inputs, config, lib, ... }: { nix = { - nixPath = [ - "nixpkgs=${inputs.nixpkgs}" - ]; - extraOptions = lib.optionalString (lib.versionAtLeast config.nix.package.version "2.4") '' - experimental-features = nix-command flakes - ''; + nixPath = [ "nixpkgs=${inputs.nixpkgs}" ]; + extraOptions = lib.optionalString + (lib.versionAtLeast config.nix.package.version "2.4") '' + experimental-features = nix-command flakes + ''; trustedUsers = [ "root" "@wheel" ]; }; nixpkgs = { - config = { - allowUnfree = true; - }; - overlays = [ - (import ../../overlay) - ]; + config = { allowUnfree = true; }; + overlays = [ (import ../../overlay) ]; }; } diff --git a/profiles/base/programs.nix b/profiles/base/programs.nix index 19b9e06..39f581e 100644 --- a/profiles/base/programs.nix +++ b/profiles/base/programs.nix @@ -1,3 +1 @@ -{ config, ... }: { - programs.mtr.enable = true; -} +{ config, ... }: { programs.mtr.enable = true; } diff --git a/profiles/base/services.nix b/profiles/base/services.nix index 73d6c31..64a434b 100644 --- a/profiles/base/services.nix +++ b/profiles/base/services.nix @@ -1,4 +1,2 @@ -{ config, ... }: { - services.localtime.enable = true; -} +{ config, ... }: { services.localtime.enable = true; } diff --git a/profiles/dev/debugging.nix b/profiles/dev/debugging.nix index 11ad803..a42a01d 100644 --- a/profiles/dev/debugging.nix +++ b/profiles/dev/debugging.nix @@ -1,6 +1 @@ -{ pkgs, ... }: { - environment.systemPackages = with pkgs; [ - gdb - lldb - ]; -} +{ pkgs, ... }: { environment.systemPackages = with pkgs; [ gdb lldb ]; } diff --git a/profiles/dev/editors.nix b/profiles/dev/editors.nix index 4e4e1bb..89a4a2c 100644 --- a/profiles/dev/editors.nix +++ b/profiles/dev/editors.nix @@ -1,5 +1 @@ -{ pkgs, ... }: { - environment.systemPackages = with pkgs; [ - nano - ]; -} +{ pkgs, ... }: { environment.systemPackages = with pkgs; [ nano ]; } diff --git a/profiles/dev/extra.nix b/profiles/dev/extra.nix index 327a768..252bf82 100644 --- a/profiles/dev/extra.nix +++ b/profiles/dev/extra.nix @@ -1,10 +1,3 @@ { pkgs, ... }: { - environment.systemPackages = with pkgs; [ - jq - ripgrep - fd - pv - tmux - socat - ]; + environment.systemPackages = with pkgs; [ jq ripgrep fd pv tmux socat ]; } diff --git a/profiles/dev/info.nix b/profiles/dev/info.nix index 9b31077..e2ef30d 100644 --- a/profiles/dev/info.nix +++ b/profiles/dev/info.nix @@ -1,7 +1,3 @@ { pkgs, ... }: { - environment.systemPackages = with pkgs; [ - neofetch - inxi - htop - ]; + environment.systemPackages = with pkgs; [ neofetch inxi htop ]; } diff --git a/profiles/dev/programming.nix b/profiles/dev/programming.nix deleted file mode 100644 index 57185e6..0000000 --- a/profiles/dev/programming.nix +++ /dev/null @@ -1,14 +0,0 @@ -{ pkgs, ... }: { - environment.systemPackages = with pkgs; [ - # Nix - nixfmt - # Go - go - gopls - go-outline - goimports - # Zig - zig - zls - ]; -} diff --git a/profiles/dev/vcs.nix b/profiles/dev/vcs.nix index 009f02b..0f5ebb7 100644 --- a/profiles/dev/vcs.nix +++ b/profiles/dev/vcs.nix @@ -1,7 +1,3 @@ { pkgs, ... }: { - environment.systemPackages = with pkgs; [ - git - darcs - subversion - ]; + environment.systemPackages = with pkgs; [ git darcs subversion ]; } diff --git a/profiles/gaming/gaming.nix b/profiles/gaming/gaming.nix index c168368..15d59e4 100644 --- a/profiles/gaming/gaming.nix +++ b/profiles/gaming/gaming.nix @@ -1,13 +1,3 @@ { pkgs, ... }: { programs.steam.enable = true; - environment.systemPackages = with pkgs; [ - steam - lutris - mgba - nestopia - snes9x-gtk - melonDS - sixpair - xboxdrv - ]; } diff --git a/profiles/gui/default.nix b/profiles/gui/default.nix index d56e27a..79da117 100644 --- a/profiles/gui/default.nix +++ b/profiles/gui/default.nix @@ -1,8 +1,5 @@ { config, pkgs, ... }: { - fonts.fonts = with pkgs; [ - comic-neue - comic-code - ]; + fonts.fonts = with pkgs; [ comic-neue comic-code ]; environment.systemPackages = with pkgs; [ tdesktop diff --git a/profiles/network_manager/nm.nix b/profiles/network_manager/nm.nix index d6e7372..e97768a 100644 --- a/profiles/network_manager/nm.nix +++ b/profiles/network_manager/nm.nix @@ -2,9 +2,7 @@ networking = { networkmanager = { enable = true; - connectionConfig = { - "ipv6.ip6-privacy" = lib.mkForce 0; - }; + connectionConfig = { "ipv6.ip6-privacy" = lib.mkForce 0; }; }; }; programs.nm-applet.enable = true; diff --git a/profiles/pulse/default.nix b/profiles/pulse/default.nix index 9c0a32d..51d9af1 100644 --- a/profiles/pulse/default.nix +++ b/profiles/pulse/default.nix @@ -6,11 +6,7 @@ support32Bit = true; extraModules = with pkgs; [ pkgs.pulseaudio-modules-bt ]; package = pkgs.pulseaudioFull; - extraConfig = " - load-module module-switch-on-connect - "; + extraConfig = "\n load-module module-switch-on-connect\n "; }; - environment.systemPackages = with pkgs; [ - pavucontrol - ]; + environment.systemPackages = with pkgs; [ pavucontrol ]; } diff --git a/profiles/sway/sway.nix b/profiles/sway/sway.nix index 16eb932..3361e55 100644 --- a/profiles/sway/sway.nix +++ b/profiles/sway/sway.nix @@ -2,6 +2,6 @@ programs.sway.enable = true; programs.xwayland.enable = true; services.xserver.enable = true; - systemd.services.display-manager.enable = true; - services.xserver.displayManager.sddm.enable = true; + #systemd.services.display-manager.enable = true; + #services.xserver.displayManager.sddm.enable = true; } diff --git a/tree.nix b/tree.nix index 8b5f6fa..347024e 100644 --- a/tree.nix +++ b/tree.nix @@ -1,4 +1,7 @@ -{ lib }: { config, folder, inputs, ... }@args: with lib; let +{ lib }: +{ config, folder, inputs, ... }@args: +with lib; +let # Made by kat witch (kittywitch) pureTreeGrab = { base, path }: let @@ -9,135 +12,127 @@ isDir = entry: _: (isDirectory entry) && !(isHidden entry); directories = filterAttrs isDir dirContents; isNixFile = entry: _: - let - result = builtins.match "(.*)\\.nix" entry; - in - result != null && builtins.length result > 0; + let result = builtins.match "(.*)\\.nix" entry; + in result != null && builtins.length result > 0; nixFiles = filterAttrs isNixFile dirContents; getPath = entry: "${realPath}/${entry}"; - getPaths = entries: mapAttrs' - (n: v: - nameValuePair (removeSuffix ".nix" n) (getPath n) - ) + getPaths = entries: + mapAttrs' (n: v: nameValuePair (removeSuffix ".nix" n) (getPath n)) entries; nixFilePaths = getPaths nixFiles; dirPaths = getPaths directories; - recursedPaths = mapAttrs - (_: fullPath: pureTreeGrab { + recursedPaths = mapAttrs (_: fullPath: + pureTreeGrab { inherit base; path = fullPath; - }) - dirPaths; + }) dirPaths; contents = recursedPaths // nixFilePaths; - in - contents; + in contents; configTreeStruct = { config, ... }: { options.treeConfig = mkOption { - type = with types; attrsOf (submodule ({ name, options, config, ... }: { - options = { - evaluateDefault = mkOption { - type = types.bool; - description = "Replace the contents of this branch or leaf with those provided by the evaluation of default.nix."; - default = false; - }; - aliasDefault = mkOption { - type = types.bool; - description = "Replace the contents of this branch or leaf with the default.nix."; - default = false; - }; - excludes = mkOption { - type = types.listOf types.str; - description = "Exclude files or folders from the recurser."; - default = [ ]; - }; - functor = { - enable = mkOption { + type = with types; + attrsOf (submodule ({ name, options, config, ... }: { + options = { + evaluateDefault = mkOption { type = types.bool; - description = "Provide a functor for the path provided"; + description = + "Replace the contents of this branch or leaf with those provided by the evaluation of default.nix."; default = false; }; - external = mkOption { - type = types.listOf types.unspecified; - description = "Add external imports into the functor."; - default = [ ]; + aliasDefault = mkOption { + type = types.bool; + description = + "Replace the contents of this branch or leaf with the default.nix."; + default = false; }; excludes = mkOption { type = types.listOf types.str; - description = "Exclude files or folders from the functor."; + description = "Exclude files or folders from the recurser."; default = [ ]; }; + functor = { + enable = mkOption { + type = types.bool; + description = "Provide a functor for the path provided"; + default = false; + }; + external = mkOption { + type = types.listOf types.unspecified; + description = "Add external imports into the functor."; + default = [ ]; + }; + excludes = mkOption { + type = types.listOf types.str; + description = "Exclude files or folders from the functor."; + default = [ ]; + }; + }; }; - }; - })); - }; - config.treeConfig = { - "*" = { }; + })); }; + config.treeConfig = { "*" = { }; }; }; configTree.treeConfig = config; configTreeModule = (evalModules { - modules = [ - configTreeStruct - configTree - ]; + modules = [ configTreeStruct configTree ]; }).config.treeConfig; mapAttrsRecursive = f: set: let recurse = path: set: let g = name: value: - if isAttrs value - then f (path ++ [ name ]) (recurse (path ++ [ name ]) value) - else f (path ++ [ name ]) value; - in - mapAttrs g set; - in - recurse [ ] set; + if isAttrs value then + f (path ++ [ name ]) (recurse (path ++ [ name ]) value) + else + f (path ++ [ name ]) value; + in mapAttrs g set; + in recurse [ ] set; getPathString = path: concatStringsSep "/" path; getConfig = path: default: configTreeModule.${getPathString path} or default; revtail = path: sublist 0 (length path - 1) path; getConfigRecursive = path: - let - parentPath = revtail path; - in - getConfig (path ++ singleton "*") (getConfigRecursive parentPath); - processLeaves = tree: config: mapAttrsRecursive - (path: value: + let parentPath = revtail path; + in getConfig (path ++ singleton "*") (getConfigRecursive parentPath); + processLeaves = tree: config: + mapAttrsRecursive (path: value: let pathString = getPathString path; leafConfig = getConfig path (getConfigRecursive (revtail path)); processConfig = path: value: let - processFunctor = prev: prev // { - __functor = self: { ... }: { - imports = attrValues (removeAttrs prev leafConfig.functor.excludes) ++ leafConfig.functor.external; + processFunctor = prev: + prev // { + __functor = self: + { ... }: { + imports = + attrValues (removeAttrs prev leafConfig.functor.excludes) + ++ leafConfig.functor.external; + }; }; - }; processAliasDefault = prev: prev.default; - processDefault = prev: import prev.default (args // { - inherit lib; - tree = { - prev = removeAttrs prev (singleton "default"); - pure = pureTree; - impure = impureTree; - }; - }); + processDefault = prev: + import prev.default (args // { + inherit lib; + tree = { + prev = removeAttrs prev (singleton "default"); + pure = pureTree; + impure = impureTree; + }; + }); processExcludes = prev: removeAttrs prev leafConfig.excludes; - processes = optionals (isAttrs value) ( - optional (leafConfig.excludes != [ ]) processExcludes - ++ optional leafConfig.evaluateDefault processDefault - ++ optional leafConfig.aliasDefault processAliasDefault - ++ optional leafConfig.functor.enable processFunctor - ); - in - pipe value processes; - in - processConfig path value) - tree; - pureTree = pureTreeGrab { base = folder; path = folder; }; + processes = optionals (isAttrs value) + (optional (leafConfig.excludes != [ ]) processExcludes + ++ optional leafConfig.evaluateDefault processDefault + ++ optional leafConfig.aliasDefault processAliasDefault + ++ optional leafConfig.functor.enable processFunctor); + in pipe value processes; + in processConfig path value) tree; + pureTree = pureTreeGrab { + base = folder; + path = folder; + }; impureTree = processLeaves pureTree configTreeModule; -in -{ +in { config = configTreeModule; pure = pureTree; impure = impureTree; diff --git a/users/chaoticryptidz/chaoticryptidz.nix b/users/chaoticryptidz/chaoticryptidz.nix index 4a05ed2..7311bc4 100644 --- a/users/chaoticryptidz/chaoticryptidz.nix +++ b/users/chaoticryptidz/chaoticryptidz.nix @@ -1,6 +1,7 @@ { config, ... }: { users.users.chaoticryptidz = { isNormalUser = true; - extraGroups = [ "wheel" "video" "systemd-journal" "plugdev" "vfio" "input" "uinput" ]; + extraGroups = + [ "wheel" "video" "systemd-journal" "plugdev" "vfio" "input" "uinput" ]; }; }