diff --git a/flake.nix b/flake.nix index c868b01..4ed7e6f 100644 --- a/flake.nix +++ b/flake.nix @@ -20,11 +20,12 @@ }; outputs = - { self - , nixpkgs - , home-manager - , ... - } @ inputs: + { + self, + nixpkgs, + home-manager, + ... + }@inputs: let inherit (self) outputs; lib = nixpkgs.lib; @@ -33,10 +34,13 @@ "aarch64-darwin" ]; forEachSystem = f: lib.genAttrs systems (system: f pkgsFor.${system}); - pkgsFor = lib.genAttrs systems (system: import nixpkgs { - inherit system; - config.allowUnfree = true; - }); + pkgsFor = lib.genAttrs systems ( + system: + import nixpkgs { + inherit system; + config.allowUnfree = true; + } + ); in { inherit lib; @@ -50,24 +54,32 @@ nixosConfigurations = { enoko = lib.nixosSystem { - specialArgs = { inherit inputs outputs; }; + specialArgs = { + inherit inputs outputs; + }; modules = [ ./nixos/enoko/configuration.nix home-manager.nixosModules.home-manager { - home-manager.extraSpecialArgs = { inherit inputs outputs; }; + home-manager.extraSpecialArgs = { + inherit inputs outputs; + }; home-manager.users.lu = import ./home/enoko.nix; } ]; }; yukari = lib.nixosSystem { - specialArgs = { inherit inputs outputs; }; + specialArgs = { + inherit inputs outputs; + }; modules = [ ./nixos/yukari/configuration.nix home-manager.nixosModules.home-manager { - home-manager.extraSpecialArgs = { inherit inputs outputs; }; + home-manager.extraSpecialArgs = { + inherit inputs outputs; + }; home-manager.users.lu = import ./home/yukari.nix; } ]; diff --git a/home/common/cli/default.nix b/home/common/cli/default.nix index 789ea1f..c0981c0 100644 --- a/home/common/cli/default.nix +++ b/home/common/cli/default.nix @@ -1,5 +1,6 @@ # Configures programs that primarily run via the command line -{ pkgs, ... }: { +{ pkgs, ... }: +{ imports = [ ./fish.nix # fish shell configuration ./neovim.nix # neovim configuration, my "escape" editor diff --git a/home/common/cli/direnv.nix b/home/common/cli/direnv.nix index 37f267d..b71ece6 100644 --- a/home/common/cli/direnv.nix +++ b/home/common/cli/direnv.nix @@ -1,4 +1,5 @@ -{ ... }: { +{ ... }: +{ programs.direnv = { enable = true; nix-direnv.enable = true; diff --git a/home/common/cli/fish.nix b/home/common/cli/fish.nix index 7ba7b54..300a455 100644 --- a/home/common/cli/fish.nix +++ b/home/common/cli/fish.nix @@ -116,13 +116,12 @@ } { name = "plugin-foreign-env"; - src = pkgs.fetchFromGitHub - { - owner = "oh-my-fish"; - repo = "plugin-foreign-env"; - rev = "7f0cf099ae1e1e4ab38f46350ed6757d54471de7"; - sha256 = "0d16mdgjdwln41zk44qa5vcilmlia4w15r8z2rc3p49i5ankksg3"; - }; + src = pkgs.fetchFromGitHub { + owner = "oh-my-fish"; + repo = "plugin-foreign-env"; + rev = "7f0cf099ae1e1e4ab38f46350ed6757d54471de7"; + sha256 = "0d16mdgjdwln41zk44qa5vcilmlia4w15r8z2rc3p49i5ankksg3"; + }; } ]; }; diff --git a/home/common/cli/lazygit.nix b/home/common/cli/lazygit.nix index 246221d..e7aa98b 100644 --- a/home/common/cli/lazygit.nix +++ b/home/common/cli/lazygit.nix @@ -1,3 +1,4 @@ -{ ... }: { +{ ... }: +{ programs.lazygit.enable = true; } diff --git a/home/common/desktop/1password.nix b/home/common/desktop/1password.nix index cdc6c55..ad7bfe3 100644 --- a/home/common/desktop/1password.nix +++ b/home/common/desktop/1password.nix @@ -1,4 +1,5 @@ -{ pkgs, ... }: { +{ pkgs, ... }: +{ home.packages = with pkgs; [ _1password-gui ]; diff --git a/home/common/desktop/alacritty.nix b/home/common/desktop/alacritty.nix index b409688..873af13 100644 --- a/home/common/desktop/alacritty.nix +++ b/home/common/desktop/alacritty.nix @@ -1,4 +1,5 @@ -{ config, lib, ... }: { +{ config, lib, ... }: +{ programs.alacritty = { enable = true; settings = { diff --git a/home/common/desktop/default.nix b/home/common/desktop/default.nix index a130189..54e9b35 100644 --- a/home/common/desktop/default.nix +++ b/home/common/desktop/default.nix @@ -1,4 +1,5 @@ -{ pkgs, ... }: { +{ pkgs, ... }: +{ imports = [ ./font.nix ./firefox.nix diff --git a/home/common/desktop/firefox.nix b/home/common/desktop/firefox.nix index 9cff9ab..ec8fb71 100644 --- a/home/common/desktop/firefox.nix +++ b/home/common/desktop/firefox.nix @@ -1,11 +1,12 @@ -{ pkgs, ... }: { +{ pkgs, ... }: +{ home.packages = with pkgs; [ fira ]; programs.firefox = { enable = true; - profiles ={ + profiles = { "user" = { userChrome = '' * { diff --git a/home/common/desktop/font.nix b/home/common/desktop/font.nix index 562971f..46c2e47 100644 --- a/home/common/desktop/font.nix +++ b/home/common/desktop/font.nix @@ -1,9 +1,10 @@ -{ pkgs, ... }: { +{ pkgs, ... }: +{ fontProfiles = { enable = true; monospace = { family = "JetBrains Mono Nerd Font"; - package = pkgs.nerdfonts.override { fonts = ["JetBrainsMono"]; }; + package = pkgs.nerdfonts.override { fonts = [ "JetBrainsMono" ]; }; }; regular = { family = "Fira Sans"; diff --git a/home/common/desktop/gtk.nix b/home/common/desktop/gtk.nix index c789c26..ee93697 100644 --- a/home/common/desktop/gtk.nix +++ b/home/common/desktop/gtk.nix @@ -1,4 +1,5 @@ -{ ... }: { +{ ... }: +{ gtk = { enable = true; }; diff --git a/home/common/desktop/vscode.nix b/home/common/desktop/vscode.nix index 64e9729..7c1d466 100644 --- a/home/common/desktop/vscode.nix +++ b/home/common/desktop/vscode.nix @@ -1,4 +1,5 @@ -{ pkgs, ... }: { +{ pkgs, ... }: +{ home.packages = with pkgs; [ vscode ]; diff --git a/home/common/desktop/wlr/default.nix b/home/common/desktop/wlr/default.nix index fbffae8..5ebdf3f 100644 --- a/home/common/desktop/wlr/default.nix +++ b/home/common/desktop/wlr/default.nix @@ -1,4 +1,5 @@ -{ pkgs, ... }: { +{ pkgs, ... }: +{ imports = [ ./mako.nix ./wofi.nix diff --git a/home/common/desktop/wlr/mako.nix b/home/common/desktop/wlr/mako.nix index 2b72c1e..e5d2f25 100644 --- a/home/common/desktop/wlr/mako.nix +++ b/home/common/desktop/wlr/mako.nix @@ -1,4 +1,5 @@ -{ config, lib, ... }: { +{ config, lib, ... }: +{ services.mako = { enable = true; font = lib.mkForce "${config.fontProfiles.regular.family} 12"; diff --git a/home/common/desktop/wlr/waybar.nix b/home/common/desktop/wlr/waybar.nix index a46374c..ab296e3 100644 --- a/home/common/desktop/wlr/waybar.nix +++ b/home/common/desktop/wlr/waybar.nix @@ -1,4 +1,5 @@ -{ config, pkgs, ... }: { +{ config, pkgs, ... }: +{ # additional deps for cava support home.packages = with pkgs; [ iniparser @@ -73,61 +74,63 @@ }; }; - style = let - inherit (config.lib.stylix.colors) withHashtag; - in '' - * { - font-family: ${config.fontProfiles.bitmap.family}, ${config.fontProfiles.monospace.family}; - font-size: 11pt; - padding: 0; - } + style = + let + inherit (config.lib.stylix.colors) withHashtag; + in + '' + * { + font-family: ${config.fontProfiles.bitmap.family}, ${config.fontProfiles.monospace.family}; + font-size: 11pt; + padding: 0; + } - window#waybar { - padding: 0; - border-radius: 0.5em; - } + window#waybar { + padding: 0; + border-radius: 0.5em; + } - #workspaces { - transition: background-color .5s, color .5s; - } + #workspaces { + transition: background-color .5s, color .5s; + } - #workspaces button { - padding: 0 6px; - } + #workspaces button { + padding: 0 6px; + } - #workspaces button.active, - #workspaces button.focused { - background-color: ${withHashtag.base05}; - color: ${withHashtag.base00}; - } + #workspaces button.active, + #workspaces button.focused { + background-color: ${withHashtag.base05}; + color: ${withHashtag.base00}; + } - #cpu, - #memory { - color: ${withHashtag.base04}; - } + #cpu, + #memory { + color: ${withHashtag.base04}; + } - #mpris { - font-size: 10pt; - margin-right: 6px; - } + #mpris { + font-size: 10pt; + margin-right: 6px; + } - #tray { - padding: 0 5px; - background-color: ${withHashtag.base02}; - } + #tray { + padding: 0 5px; + background-color: ${withHashtag.base02}; + } - #pulseaudio { - color: ${withHashtag.base0D}; - } + #pulseaudio { + color: ${withHashtag.base0D}; + } - #network { - color: ${withHashtag.base0C}; - } + #network { + color: ${withHashtag.base0C}; + } - #language { - color: ${withHashtag.base02}; - margin-left: 10px; - } - ''; + #language { + color: ${withHashtag.base02}; + margin-left: 10px; + } + ''; }; } diff --git a/home/common/desktop/wlr/wofi.nix b/home/common/desktop/wlr/wofi.nix index 02bf678..163d525 100644 --- a/home/common/desktop/wlr/wofi.nix +++ b/home/common/desktop/wlr/wofi.nix @@ -1,4 +1,5 @@ -{ config, lib, ... }: { +{ config, lib, ... }: +{ programs.wofi = { enable = true; settings = { diff --git a/home/common/universal/default.nix b/home/common/universal/default.nix index 3e72bf4..6d1187b 100644 --- a/home/common/universal/default.nix +++ b/home/common/universal/default.nix @@ -1,4 +1,5 @@ -{ pkgs, ... }: { +{ pkgs, ... }: +{ imports = [ ./mise.nix ./php.nix diff --git a/home/common/universal/mise.nix b/home/common/universal/mise.nix index f1252dc..ec5a9c7 100644 --- a/home/common/universal/mise.nix +++ b/home/common/universal/mise.nix @@ -1,4 +1,5 @@ -{ pkgs, ... }: { +{ pkgs, ... }: +{ home.packages = with pkgs; [ python3 # needed for installing node.js ]; diff --git a/home/common/universal/php.nix b/home/common/universal/php.nix index 39bb614..5d5979d 100644 --- a/home/common/universal/php.nix +++ b/home/common/universal/php.nix @@ -1,6 +1,7 @@ # install php from nixpkgs because mise wants to compile it from source, # and that's a whole can of beans i'm not getting into -{ pkgs, ... }: { +{ pkgs, ... }: +{ home.packages = with pkgs; [ php83 ]; diff --git a/home/desktop/games/default.nix b/home/desktop/games/default.nix index a680d35..4ce5002 100644 --- a/home/desktop/games/default.nix +++ b/home/desktop/games/default.nix @@ -1,4 +1,5 @@ -{ pkgs, ... }: { +{ pkgs, ... }: +{ home.packages = with pkgs; [ xivlauncher ]; diff --git a/home/desktop/hyprland/default.nix b/home/desktop/hyprland/default.nix index 1ade1a1..0d10275 100644 --- a/home/desktop/hyprland/default.nix +++ b/home/desktop/hyprland/default.nix @@ -1,4 +1,9 @@ -{ lib, config, pkgs, ... }: +{ + lib, + config, + pkgs, + ... +}: { imports = [ ../../common/desktop @@ -100,101 +105,109 @@ "SUPER,mouse:273,resizewindow" ]; - bind = let - terminal = "${pkgs.alacritty}/bin/alacritty"; - grimblast = lib.getExe pkgs.grimblast; - workspaces = [ - "1" - "2" - "3" - "4" - "5" - ]; - directions = rec { - left = "l"; - right = "r"; - up = "u"; - down = "d"; - h = left; - l = right; - k = up; - j = down; - }; - in [ - "SUPER,Return,exec,${terminal}" - "SUPERSHIFT,q,killactive" # exit program - "SUPERSHIFT,e,exit" # exit hyprland - "SUPERSHIFT,r,exec,hyprctl reload" # reload currently running hyprland - - "SUPER,s,togglesplit" # horizontal split - "SUPER,f,fullscreen,1" # borderless window - "SUPERSHIFT,f,fullscreen,0" # proper fullscreen - "ALTSHIFT,space,togglefloating" # floating window - - "SUPER,minus,splitratio,-0.25" # split gets slightly smaller - "SUPERSHIFT,minus,splitratio,-0.3333333" # split gets smaller - "SUPER,equal,splitratio,0.25" # split gets slightly larger - "SUPERSHIFT,equal,splitratio,0.3333333" # split gets larger - - "SUPER,g,togglegroup" # make a window group - "SUPER,t,lockactivegroup,toggle" # lock/unlock the current group - "SUPER,tab,changegroupactive,f" # switch to next window in group - "SUPERSHIFT,tab,changegroupactive,p" # switch to prev window in group - - "SUPER,dead_grave,workspace,previous" # prev workspace - "SUPER,dead_grave,workspace,next" # next workspace - - "SUPER,u,togglespecialworkspace" # toggle special workspace - "SUPERSHIFT,u,movetoworkspacesilent,special" # move to special workspace - - ",Print,exec,${grimblast} --notify --freeze copy area" # screenshot area - "SHIFT,Print,exec,${grimblast} --notify --freeze copy output" # screenshot all - - ",XF86AudioRaiseVolume,exec,pamixer -i 5" # raise volume - ",XF86AudioLowerVolume,exec,pamixer -d 5" # lower volume - ",XF86AudioPlay,exec,playerctl play-pause" # play/pause - ",XF86AudioNext,exec,playerctl next" # next song - ",XF86AudioPrev,exec,playerctl previous" # previous song - ] - ++ - # change workspace - (map (n: "SUPER,${n},workspace,name:${n}") workspaces) - ++ - # move window to workspace - (map (n: "SUPERSHIFT,${n},movetoworkspacesilent,name:${n}") workspaces) - ++ - # move focus - (lib.mapAttrsToList (key: direction: "SUPER,${key},movefocus,${direction}") directions) - ++ - # swap windows - (lib.mapAttrsToList (key: direction: "SUPERSHIFT,${key},swapwindow,${direction}") directions) - ++ - # move windows - (lib.mapAttrsToList (key: direction: "SUPERCONTROL,${key},movewindoworgroup,${direction}") directions) - ++ - # move monitor focus - (lib.mapAttrsToList (key: direction: "SUPERALT,${key},focusmonitor,${direction}") directions) - ++ - # move workspace to other monitor - (lib.mapAttrsToList (key: direction: "SUPERALTSHIFT,${key},movecurrentworkspacetomonitor,${direction}") directions) - ++ - # launcher - ( + bind = let - wofi = lib.getExe pkgs.wofi; - in - lib.optionals config.programs.wofi.enable [ - "SUPER,Space,exec,${wofi} -S drun -W 20% -H 15%" - "SHIFTSUPER,Space,exec,${wofi} -S run -W 20% -H 15%" - ] - ); + terminal = "${pkgs.alacritty}/bin/alacritty"; + grimblast = lib.getExe pkgs.grimblast; + workspaces = [ + "1" + "2" + "3" + "4" + "5" + ]; + directions = rec { + left = "l"; + right = "r"; + up = "u"; + down = "d"; + h = left; + l = right; + k = up; + j = down; + }; + in + [ + "SUPER,Return,exec,${terminal}" + "SUPERSHIFT,q,killactive" # exit program + "SUPERSHIFT,e,exit" # exit hyprland + "SUPERSHIFT,r,exec,hyprctl reload" # reload currently running hyprland + + "SUPER,s,togglesplit" # horizontal split + "SUPER,f,fullscreen,1" # borderless window + "SUPERSHIFT,f,fullscreen,0" # proper fullscreen + "ALTSHIFT,space,togglefloating" # floating window + + "SUPER,minus,splitratio,-0.25" # split gets slightly smaller + "SUPERSHIFT,minus,splitratio,-0.3333333" # split gets smaller + "SUPER,equal,splitratio,0.25" # split gets slightly larger + "SUPERSHIFT,equal,splitratio,0.3333333" # split gets larger + + "SUPER,g,togglegroup" # make a window group + "SUPER,t,lockactivegroup,toggle" # lock/unlock the current group + "SUPER,tab,changegroupactive,f" # switch to next window in group + "SUPERSHIFT,tab,changegroupactive,p" # switch to prev window in group + + "SUPER,dead_grave,workspace,previous" # prev workspace + "SUPER,dead_grave,workspace,next" # next workspace + + "SUPER,u,togglespecialworkspace" # toggle special workspace + "SUPERSHIFT,u,movetoworkspacesilent,special" # move to special workspace + + ",Print,exec,${grimblast} --notify --freeze copy area" # screenshot area + "SHIFT,Print,exec,${grimblast} --notify --freeze copy output" # screenshot all + + ",XF86AudioRaiseVolume,exec,pamixer -i 5" # raise volume + ",XF86AudioLowerVolume,exec,pamixer -d 5" # lower volume + ",XF86AudioPlay,exec,playerctl play-pause" # play/pause + ",XF86AudioNext,exec,playerctl next" # next song + ",XF86AudioPrev,exec,playerctl previous" # previous song + ] + ++ + # change workspace + (map (n: "SUPER,${n},workspace,name:${n}") workspaces) + ++ + # move window to workspace + (map (n: "SUPERSHIFT,${n},movetoworkspacesilent,name:${n}") workspaces) + ++ + # move focus + (lib.mapAttrsToList (key: direction: "SUPER,${key},movefocus,${direction}") directions) + ++ + # swap windows + (lib.mapAttrsToList (key: direction: "SUPERSHIFT,${key},swapwindow,${direction}") directions) + ++ + # move windows + (lib.mapAttrsToList ( + key: direction: "SUPERCONTROL,${key},movewindoworgroup,${direction}" + ) directions) + ++ + # move monitor focus + (lib.mapAttrsToList (key: direction: "SUPERALT,${key},focusmonitor,${direction}") directions) + ++ + # move workspace to other monitor + (lib.mapAttrsToList ( + key: direction: "SUPERALTSHIFT,${key},movecurrentworkspacetomonitor,${direction}" + ) directions) + ++ + # launcher + ( + let + wofi = lib.getExe pkgs.wofi; + in + lib.optionals config.programs.wofi.enable [ + "SUPER,Space,exec,${wofi} -S drun -W 20% -H 15%" + "SHIFTSUPER,Space,exec,${wofi} -S run -W 20% -H 15%" + ] + ); monitor = map ( - m: "${m.name},${ - if m.enabled - then "${toString m.width}x${toString m.height}@${toString m.refreshRate},${m.position},${m.scale}" - else "disable" - }" + m: + "${m.name},${ + if m.enabled then + "${toString m.width}x${toString m.height}@${toString m.refreshRate},${m.position},${m.scale}" + else + "disable" + }" ) config.monitors; workspace = map (m: "name:${m.workspace},monitor:${m.name}") ( diff --git a/home/desktop/hyprland/swayidle.nix b/home/desktop/hyprland/swayidle.nix index e36e36a..a2313aa 100644 --- a/home/desktop/hyprland/swayidle.nix +++ b/home/desktop/hyprland/swayidle.nix @@ -1,6 +1,8 @@ -{ config, ... }: let +{ config, ... }: +let swaylock = "${config.programs.swaylock.package}/bin/swaylock"; -in { +in +{ services.swayidle = { enable = true; systemdTarget = "graphical-session.target"; diff --git a/home/desktop/hyprland/swaylock.nix b/home/desktop/hyprland/swaylock.nix index c663548..415e355 100644 --- a/home/desktop/hyprland/swaylock.nix +++ b/home/desktop/hyprland/swaylock.nix @@ -1,4 +1,5 @@ -{ pkgs, ... }: { +{ pkgs, ... }: +{ programs.swaylock = { enable = true; package = pkgs.swaylock-effects; diff --git a/home/enoko.nix b/home/enoko.nix index 44b73aa..7f7650f 100644 --- a/home/enoko.nix +++ b/home/enoko.nix @@ -1,5 +1,6 @@ # enoko is my framework 13-inch AMD laptop, running nixos -{ ... }: { +{ ... }: +{ imports = [ ./global.nix ./common/desktop diff --git a/home/global.nix b/home/global.nix index d0cbc62..66afb75 100644 --- a/home/global.nix +++ b/home/global.nix @@ -1,4 +1,12 @@ -{ inputs, lib, pkgs, config, outputs, ... }: { +{ + inputs, + lib, + pkgs, + config, + outputs, + ... +}: +{ imports = [ inputs.nix-index-database.hmModules.nix-index inputs.stylix.homeManagerModules.stylix @@ -17,13 +25,16 @@ nix = { package = lib.mkDefault pkgs.nixVersions.nix_2_22; settings = { - experimental-features = ["nix-command" "flakes"]; + experimental-features = [ + "nix-command" + "flakes" + ]; warn-dirty = false; }; }; systemd.user.startServices = "sd-switch"; - + programs = { home-manager.enable = true; }; @@ -38,7 +49,7 @@ username = lib.mkDefault "lu"; homeDirectory = lib.mkDefault "/home/${config.home.username}"; stateVersion = lib.mkDefault "24.05"; - sessionPath = ["$HOME/.local/bin"]; + sessionPath = [ "$HOME/.local/bin" ]; sessionVariables = { FLAKE = "$HOME/nix-config"; }; diff --git a/home/yukari.nix b/home/yukari.nix index 5f68a97..a5a2898 100644 --- a/home/yukari.nix +++ b/home/yukari.nix @@ -1,5 +1,6 @@ # yukari my main desktop workstation, running nixos -{ ... }: { +{ ... }: +{ imports = [ ./global.nix ./desktop/hyprland diff --git a/modules/home-manager/fonts.nix b/modules/home-manager/fonts.nix index fab19e0..beb5a99 100644 --- a/modules/home-manager/fonts.nix +++ b/modules/home-manager/fonts.nix @@ -2,7 +2,8 @@ lib, config, ... -}: let +}: +let mkFontOption = kind: { family = lib.mkOption { type = lib.types.str; @@ -18,7 +19,8 @@ }; }; cfg = config.fontProfiles; -in { +in +{ options.fontProfiles = { enable = lib.mkEnableOption "Whether to enable font profiles"; monospace = mkFontOption "monospace"; diff --git a/modules/home-manager/monitors.nix b/modules/home-manager/monitors.nix index 21aeff1..d0dbbff 100644 --- a/modules/home-manager/monitors.nix +++ b/modules/home-manager/monitors.nix @@ -2,9 +2,11 @@ lib, config, ... -}: let +}: +let inherit (lib) mkOption types; -in { +in +{ options.monitors = mkOption { type = types.listOf ( types.submodule { @@ -48,7 +50,7 @@ in { }; } ); - default = []; + default = [ ]; }; config = { assertions = [ diff --git a/nixos/common/audio.nix b/nixos/common/audio.nix index 9eed77c..e95ceea 100644 --- a/nixos/common/audio.nix +++ b/nixos/common/audio.nix @@ -1,4 +1,5 @@ -{ pkgs, ... }: { +{ pkgs, ... }: +{ security.rtkit.enable = true; services.pipewire = { enable = true; @@ -9,5 +10,5 @@ }; environment.systemPackages = with pkgs; [ pavucontrol - ]; + ]; } diff --git a/nixos/common/bluetooth.nix b/nixos/common/bluetooth.nix index 89106aa..6c1d179 100644 --- a/nixos/common/bluetooth.nix +++ b/nixos/common/bluetooth.nix @@ -1,4 +1,5 @@ -{ ... }: { +{ ... }: +{ hardware.bluetooth = { enable = true; }; diff --git a/nixos/common/default.nix b/nixos/common/default.nix index d792304..5ca5374 100644 --- a/nixos/common/default.nix +++ b/nixos/common/default.nix @@ -1,4 +1,5 @@ -{ lib, pkgs, ... }: { +{ lib, pkgs, ... }: +{ imports = [ ./audio.nix ./tailscale.nix @@ -26,7 +27,7 @@ # }; }; - users.users.lu.extraGroups = ["audio"]; + users.users.lu.extraGroups = [ "audio" ]; # auto mount external drives services.devmon.enable = true; diff --git a/nixos/common/tailscale.nix b/nixos/common/tailscale.nix index b8ff8a2..0d7c456 100644 --- a/nixos/common/tailscale.nix +++ b/nixos/common/tailscale.nix @@ -1,4 +1,5 @@ -{ ... }: { +{ ... }: +{ services.tailscale = { enable = true; }; diff --git a/nixos/desktop/hyprland.nix b/nixos/desktop/hyprland.nix index 278140b..c43fc83 100644 --- a/nixos/desktop/hyprland.nix +++ b/nixos/desktop/hyprland.nix @@ -1,3 +1,4 @@ -{ ... }: { - security.pam.services.swaylock = {}; +{ ... }: +{ + security.pam.services.swaylock = { }; } diff --git a/nixos/desktop/plasma.nix b/nixos/desktop/plasma.nix index a9070b3..e10394c 100644 --- a/nixos/desktop/plasma.nix +++ b/nixos/desktop/plasma.nix @@ -1,4 +1,5 @@ -{ ... }: { +{ ... }: +{ services.displayManager.sddm.enable = true; services.displayManager.sddm.wayland.enable = true; services.desktopManager.plasma6.enable = true; diff --git a/nixos/enoko/configuration.nix b/nixos/enoko/configuration.nix index 2f99465..d964133 100644 --- a/nixos/enoko/configuration.nix +++ b/nixos/enoko/configuration.nix @@ -1,9 +1,11 @@ -{ inputs -, lib -, config -, pkgs -, ... -}: { +{ + inputs, + lib, + config, + pkgs, + ... +}: +{ imports = [ ../common ./hardware-configuration.nix @@ -63,7 +65,10 @@ lu = { shell = pkgs.fish; isNormalUser = true; - extraGroups = [ "wheel" "storage" ]; + extraGroups = [ + "wheel" + "storage" + ]; }; }; @@ -90,7 +95,9 @@ # enable ppd specifically for the framework services.power-profiles-daemon.enable = true; - boot.kernelParams = lib.optionals (lib.versionOlder config.boot.kernelPackages.kernel.version "6.8") ["rtc_cmos.use_acpi_alarm=1"] ; + boot.kernelParams = + lib.optionals (lib.versionOlder config.boot.kernelPackages.kernel.version "6.8") + [ "rtc_cmos.use_acpi_alarm=1" ]; # https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion system.stateVersion = "24.05"; diff --git a/nixos/enoko/hardware-configuration.nix b/nixos/enoko/hardware-configuration.nix index e1e0e82..9610fd8 100644 --- a/nixos/enoko/hardware-configuration.nix +++ b/nixos/enoko/hardware-configuration.nix @@ -1,28 +1,42 @@ # 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, modulesPath, ... }: +{ + config, + lib, + modulesPath, + ... +}: { - imports = - [ (modulesPath + "/installer/scan/not-detected.nix") - ]; + imports = [ + (modulesPath + "/installer/scan/not-detected.nix") + ]; - boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "thunderbolt" "usb_storage" "sd_mod" ]; + boot.initrd.availableKernelModules = [ + "nvme" + "xhci_pci" + "thunderbolt" + "usb_storage" + "sd_mod" + ]; boot.initrd.kernelModules = [ ]; boot.kernelModules = [ "kvm-amd" ]; boot.extraModulePackages = [ ]; - fileSystems."/" = - { device = "/dev/disk/by-uuid/8e4fa7a2-0690-4276-b47d-0aa9fe3e62fd"; - fsType = "ext4"; - }; + fileSystems."/" = { + device = "/dev/disk/by-uuid/8e4fa7a2-0690-4276-b47d-0aa9fe3e62fd"; + fsType = "ext4"; + }; - fileSystems."/boot" = - { device = "/dev/disk/by-uuid/6157-ADC8"; - fsType = "vfat"; - options = [ "fmask=0022" "dmask=0022" ]; - }; + fileSystems."/boot" = { + device = "/dev/disk/by-uuid/6157-ADC8"; + fsType = "vfat"; + options = [ + "fmask=0022" + "dmask=0022" + ]; + }; swapDevices = [ ]; diff --git a/nixos/services/postgres.nix b/nixos/services/postgres.nix index 5dc8b97..0d960ef 100644 --- a/nixos/services/postgres.nix +++ b/nixos/services/postgres.nix @@ -1,9 +1,15 @@ -{ ... }: { +{ ... }: +{ services.postgresql = { enable = true; ensureUsers = [ - { name = "lu"; ensureClauses = { superuser = true; }; } + { + name = "lu"; + ensureClauses = { + superuser = true; + }; + } ]; }; } diff --git a/nixos/yukari/configuration.nix b/nixos/yukari/configuration.nix index 60f3f03..5dc2f2f 100644 --- a/nixos/yukari/configuration.nix +++ b/nixos/yukari/configuration.nix @@ -1,9 +1,11 @@ -{ inputs -, lib -, config -, pkgs -, ... -}: { +{ + inputs, + lib, + config, + pkgs, + ... +}: +{ imports = [ ../common ./hardware-configuration.nix @@ -34,7 +36,7 @@ boot.loader.systemd-boot.enable = true; boot.loader.efi.canTouchEfiVariables = true; - boot.initrd.kernelModules = ["amdgpu"]; + boot.initrd.kernelModules = [ "amdgpu" ]; hardware.graphics.enable = true; networking.hostName = "yukari"; @@ -63,7 +65,10 @@ lu = { shell = pkgs.fish; isNormalUser = true; - extraGroups = [ "wheel" "storage" ]; + extraGroups = [ + "wheel" + "storage" + ]; }; }; diff --git a/nixos/yukari/hardware-configuration.nix b/nixos/yukari/hardware-configuration.nix index 7663dea..a558195 100644 --- a/nixos/yukari/hardware-configuration.nix +++ b/nixos/yukari/hardware-configuration.nix @@ -1,32 +1,48 @@ # 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" "usb_storage" "usbhid" "sd_mod" ]; + boot.initrd.availableKernelModules = [ + "xhci_pci" + "ahci" + "nvme" + "usb_storage" + "usbhid" + "sd_mod" + ]; boot.initrd.kernelModules = [ ]; boot.kernelModules = [ "kvm-intel" ]; boot.extraModulePackages = [ ]; - fileSystems."/" = - { device = "/dev/disk/by-uuid/d8551435-6a35-4ae9-b977-fd5a261c9be7"; - fsType = "ext4"; - }; + fileSystems."/" = { + device = "/dev/disk/by-uuid/d8551435-6a35-4ae9-b977-fd5a261c9be7"; + fsType = "ext4"; + }; - fileSystems."/boot" = - { device = "/dev/disk/by-uuid/5704-1642"; - fsType = "vfat"; - options = [ "fmask=0077" "dmask=0077" ]; - }; - - swapDevices = - [ { device = "/dev/disk/by-uuid/d52209e9-f625-46a9-800a-88598ed6fcd5"; } + fileSystems."/boot" = { + device = "/dev/disk/by-uuid/5704-1642"; + fsType = "vfat"; + options = [ + "fmask=0077" + "dmask=0077" ]; + }; + + swapDevices = [ + { device = "/dev/disk/by-uuid/d52209e9-f625-46a9-800a-88598ed6fcd5"; } + ]; # 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 index 88bed98..be2163e 100644 --- a/overlays/default.nix +++ b/overlays/default.nix @@ -1,5 +1,6 @@ # This file defines overlays -{inputs, ...}: { +{ inputs, ... }: +{ # This one brings our custom packages from the 'pkgs' directory additions = final: _prev: import ../pkgs final.pkgs; diff --git a/shell.nix b/shell.nix index c32a8bd..7bf29a1 100644 --- a/shell.nix +++ b/shell.nix @@ -1,14 +1,17 @@ # Shell for bootstrapping flake-enabled nix and other tooling -{ pkgs ? let - lock = (builtins.fromJSON (builtins.readFile ./flake.lock)).nodes.nixpkgs.locked; - nixpkgs = fetchTarball { - url = "https://github.com/nixos/nixpkgs/archive/${lock.rev}.tar.gz"; - sha256 = lock.narHash; - }; - in - import nixpkgs { overlays = [ ]; } -, ... -}: { +{ + pkgs ? + let + lock = (builtins.fromJSON (builtins.readFile ./flake.lock)).nodes.nixpkgs.locked; + nixpkgs = fetchTarball { + url = "https://github.com/nixos/nixpkgs/archive/${lock.rev}.tar.gz"; + sha256 = lock.narHash; + }; + in + import nixpkgs { overlays = [ ]; }, + ... +}: +{ default = pkgs.mkShell { NIX_CONFIG = "extra-experimental-features = nix-command flakes"; nativeBuildInputs = with pkgs; [