treewide: format with nixfmt

This commit is contained in:
insects 2024-09-22 10:56:40 +02:00
parent 303e982a8e
commit 26ad72592a
47 changed files with 380 additions and 725 deletions

View file

@ -1,9 +1,5 @@
{ pkgs, ... }: {
nixpkgs = {
config = {
allowUnfree = true;
};
};
nixpkgs = { config = { allowUnfree = true; }; };
services.nix-daemon.enable = true;
nix.settings.experimental-features = "nix-command flakes";

View file

@ -1,5 +1,6 @@
{
description = "Mine very own Nix(OS) / home-manager / nix-darwin configuration";
description =
"Mine very own Nix(OS) / home-manager / nix-darwin configuration";
inputs = {
# Nixpkgs
@ -26,31 +27,18 @@
nixos-hardware.url = "github:NixOS/nixos-hardware/master";
};
outputs =
{ self
, nixpkgs
, home-manager
, nixos-hardware
, darwin
, ...
}@inputs:
outputs = { self, nixpkgs, home-manager, nixos-hardware, darwin, ... }@inputs:
let
inherit (self) outputs;
lib = nixpkgs.lib;
systems = [
"x86_64-linux"
"aarch64-darwin"
];
systems = [ "x86_64-linux" "aarch64-darwin" ];
forEachSystem = f: lib.genAttrs systems (system: f pkgsFor.${system});
pkgsFor = lib.genAttrs systems (
system:
pkgsFor = lib.genAttrs systems (system:
import nixpkgs {
inherit system;
config.allowUnfree = true;
}
);
in
{
});
in {
inherit lib;
packages = forEachSystem (pkgs: import ./pkgs { inherit pkgs; });
devShells = forEachSystem (pkgs: import ./shell.nix { inherit pkgs; });
@ -62,33 +50,25 @@
nixosConfigurations = {
enoko = lib.nixosSystem {
specialArgs = {
inherit inputs outputs;
};
specialArgs = { inherit inputs outputs; };
modules = [
./nixos/enoko/configuration.nix
nixos-hardware.nixosModules.framework-13-7040-amd
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;
}
];
@ -102,9 +82,7 @@
./darwin/koishi/configuration.nix
home-manager.darwinModules.home-manager
{
home-manager.extraSpecialArgs = {
inherit inputs outputs;
};
home-manager.extraSpecialArgs = { inherit inputs outputs; };
home-manager.users.lu = import ./home/koishi.nix;
}
];

View file

@ -1,23 +1,16 @@
# enoko is my framework 13-inch AMD laptop, running nixos
{ ... }:
{
imports = [
./global.nix
./global.linux.nix
./features/desktop
];
{ ... }: {
imports = [ ./global.nix ./global.linux.nix ./features/desktop ];
config.monitors = [
{
name = "eDP-1";
width = 2256;
height = 1504;
workspace = "1";
primary = true;
position = "0x0";
scale = "1.175000";
}
];
config.monitors = [{
name = "eDP-1";
width = 2256;
height = 1504;
workspace = "1";
primary = true;
position = "0x0";
scale = "1.175000";
}];
# Fix HiDPI scaling
# config.wayland.windowManager.hyprland = {

View file

@ -1,5 +1,4 @@
{ ... }:
{
{ ... }: {
programs.direnv = {
enable = true;
nix-direnv.enable = true;

View file

@ -1,4 +1 @@
{ ... }:
{
programs.lazygit.enable = true;
}
{ ... }: { programs.lazygit.enable = true; }

View file

@ -1,16 +1,12 @@
{ pkgs, ... }:
{
home.packages = with pkgs; [
python3 # needed for installing node.js
];
{ pkgs, ... }: {
home.packages = with pkgs;
[
python3 # needed for installing node.js
];
programs.mise = {
enable = true;
enableFishIntegration = true;
globalConfig = {
tools = {
node = "lts";
};
};
globalConfig = { tools = { node = "lts"; }; };
};
}

View file

@ -1,6 +1 @@
{ pkgs, ... }:
{
home.packages = with pkgs; [
_1password-gui
];
}
{ pkgs, ... }: { home.packages = with pkgs; [ _1password-gui ]; }

View file

@ -1,5 +1,4 @@
{ config, lib, ... }:
{
{ config, lib, ... }: {
programs.alacritty = {
enable = true;
settings = {

View file

@ -1,5 +1,4 @@
{ pkgs, ... }:
{
{ pkgs, ... }: {
imports = [
./font.nix
./firefox.nix

View file

@ -1,9 +1,4 @@
{ pkgs, ... }:
{
home.packages = with pkgs; [
fira
];
programs.firefox = {
enable = true;
};
{ pkgs, ... }: {
home.packages = with pkgs; [ fira ];
programs.firefox = { enable = true; };
}

View file

@ -1,10 +1,5 @@
{ pkgs, ... }:
{
home.packages = with pkgs; [
recursive
noto-fonts-cjk
noto-fonts-emoji
];
{ pkgs, ... }: {
home.packages = with pkgs; [ recursive noto-fonts-cjk noto-fonts-emoji ];
fontProfiles = {
enable = true;
monospace = {

View file

@ -1,7 +1 @@
{ pkgs, ... }:
{
home.packages = with pkgs; [
xivlauncher
prismlauncher
];
}
{ pkgs, ... }: { home.packages = with pkgs; [ xivlauncher prismlauncher ]; }

View file

@ -1,28 +1,11 @@
{
lib,
config,
pkgs,
...
}:
{
imports = [
../default.nix
../wlr
./swaylock.nix
./swayidle.nix
];
{ lib, config, pkgs, ... }: {
imports = [ ../default.nix ../wlr ./swaylock.nix ./swayidle.nix ];
home.packages = with pkgs; [
grimblast
pamixer
playerctl
];
home.packages = with pkgs; [ grimblast pamixer playerctl ];
wayland.windowManager.hyprland = {
enable = true;
systemd = {
enable = true;
};
systemd = { enable = true; };
settings = {
general = {
@ -32,12 +15,10 @@
};
cursor.inactive_timeout = 4;
device = [
{
name = "royuan-akko-keyboard";
kb_layout = "us_intl";
}
];
device = [{
name = "royuan-akko-keyboard";
kb_layout = "us_intl";
}];
dwindle = {
split_width_multiplier = 1.35;
@ -51,14 +32,8 @@
"ignorezero,^(wofi)$"
];
windowrulev2 =
let
steam = "title:^()$,class:^(steam)$";
in
[
"stayfocused, ${steam}"
"minsize 1 1, ${steam}"
];
windowrulev2 = let steam = "title:^()$,class:^(steam)$";
in [ "stayfocused, ${steam}" "minsize 1 1, ${steam}" ];
decoration = {
active_opacity = 1.0;
@ -109,119 +84,100 @@
];
};
bindm = [
"SUPER,mouse:272,movewindow"
"SUPER,mouse:273,resizewindow"
];
bindm = [ "SUPER,mouse:272,movewindow" "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
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,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,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,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,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
"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
",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%"
]
);
",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:
monitor = map (m:
"${m.name},${
if m.enabled then
"${toString m.width}x${toString m.height}@${toString m.refreshRate},${m.position},${m.scale}"
"${toString m.width}x${toString m.height}@${
toString m.refreshRate
},${m.position},${m.scale}"
else
"disable"
}"
) config.monitors;
}") config.monitors;
workspace = map (m: "name:${m.workspace},monitor:${m.name}") (
lib.filter (m: m.enabled && m.workspace != null) config.monitors
);
workspace = map (m: "name:${m.workspace},monitor:${m.name}")
(lib.filter (m: m.enabled && m.workspace != null) config.monitors);
};
};
}

View file

@ -1,17 +1,13 @@
{ config, ... }:
let
swaylock = "${config.programs.swaylock.package}/bin/swaylock";
in
{
let swaylock = "${config.programs.swaylock.package}/bin/swaylock";
in {
services.swayidle = {
enable = true;
systemdTarget = "graphical-session.target";
events = [
{
event = "before-sleep";
command = "${swaylock} --daemonize";
}
];
events = [{
event = "before-sleep";
command = "${swaylock} --daemonize";
}];
# timeouts = [
# {
# timeout = 4 * 60;

View file

@ -1,10 +1,7 @@
{ pkgs, ... }:
{
{ pkgs, ... }: {
programs.swaylock = {
enable = true;
package = pkgs.swaylock-effects;
settings = {
effect-blur = "20x3";
};
settings = { effect-blur = "20x3"; };
};
}

View file

@ -1,5 +1 @@
{ pkgs, ... }: {
home.packages = with pkgs; [
quassel
];
}
{ pkgs, ... }: { home.packages = with pkgs; [ quassel ]; }

View file

@ -1,9 +1,6 @@
{ pkgs, ... }:
{
{ pkgs, ... }: {
programs.obs-studio = {
enable = true;
plugins = with pkgs.obs-studio-plugins; [
obs-tuna
];
plugins = with pkgs.obs-studio-plugins; [ obs-tuna ];
};
}

View file

@ -1,6 +1 @@
{ pkgs, ... }:
{
home.packages = with pkgs; [
vscode
];
}
{ pkgs, ... }: { home.packages = with pkgs; [ vscode ]; }

View file

@ -1,10 +1,5 @@
{ pkgs, ... }:
{
imports = [
./mako.nix
./wofi.nix
./waybar.nix
];
{ pkgs, ... }: {
imports = [ ./mako.nix ./wofi.nix ./waybar.nix ];
home.packages = with pkgs; [
wf-recorder
@ -19,12 +14,6 @@
xdg.portal = {
enable = true;
extraPortals = [ pkgs.xdg-desktop-portal-wlr ];
config = {
common = {
default = [
"wlr"
];
};
};
config = { common = { default = [ "wlr" ]; }; };
};
}

View file

@ -1,5 +1,4 @@
{ config, lib, ... }:
{
{ config, lib, ... }: {
services.mako = {
enable = true;
font = lib.mkForce "${config.fontProfiles.regular.family} 12";

View file

@ -1,10 +1,6 @@
{ config, pkgs, ... }:
{
{ config, pkgs, ... }: {
# additional deps for cava support
home.packages = with pkgs; [
iniparser
fftw
];
home.packages = with pkgs; [ iniparser fftw ];
systemd.user.services.waybar = {
Unit.StartLimitBurst = 30;
@ -21,40 +17,19 @@
margin-top = 10;
margin-left = 20;
margin-right = 20;
modules-left = [
"hyprland/workspaces"
"hyprland/language"
];
modules-left = [ "hyprland/workspaces" "hyprland/language" ];
modules-center = [
"cpu"
"clock"
"memory"
];
modules-center = [ "cpu" "clock" "memory" ];
modules-right = [
"mpris"
"network"
"pulseaudio"
"battery"
"tray"
];
modules-right = [ "mpris" "network" "pulseaudio" "battery" "tray" ];
cpu = {
format = "CPU {usage}%";
};
cpu = { format = "CPU {usage}%"; };
memory = {
format = "MEM {}%";
};
memory = { format = "MEM {}%"; };
tray = {
spacing = 10;
};
tray = { spacing = 10; };
pulseaudio = {
format = "AUD {volume}%";
};
pulseaudio = { format = "AUD {volume}%"; };
network = {
format = "NET {ipaddr}";
@ -74,63 +49,60 @@
};
};
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;
}
'';
};
}

View file

@ -1,5 +1,4 @@
{ config, lib, ... }:
{
{ config, lib, ... }: {
programs.wofi = {
enable = true;
settings = {

View file

@ -1,8 +1,5 @@
{ pkgs, ... }:
{
imports = [
./php.nix
];
{ pkgs, ... }: {
imports = [ ./php.nix ];
home.packages = with pkgs; [
gcc

View file

@ -1,8 +1,5 @@
# 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, ... }:
{
home.packages = with pkgs; [
php83
];
{ pkgs, ... }: {
home.packages = with pkgs; [ php83 ];
}

View file

@ -1,11 +1,4 @@
{ inputs
, lib
, pkgs
, config
, outputs
, ...
}:
{
{ inputs, lib, pkgs, config, outputs, ... }: {
imports = [
inputs.nix-index-database.hmModules.nix-index
inputs.stylix.homeManagerModules.stylix
@ -24,17 +17,12 @@
nix = {
package = lib.mkDefault pkgs.nixVersions.nix_2_22;
settings = {
experimental-features = [
"nix-command"
"flakes"
];
experimental-features = [ "nix-command" "flakes" ];
warn-dirty = false;
};
};
programs = {
home-manager.enable = true;
};
programs = { home-manager.enable = true; };
programs.git = {
enable = true;
@ -56,16 +44,15 @@
homeDirectory = lib.mkDefault "/home/${config.home.username}";
stateVersion = lib.mkDefault "24.05";
sessionPath = [ "$HOME/.local/bin" ];
sessionVariables = {
FLAKE = "$HOME/nix-config";
};
sessionVariables = { FLAKE = "$HOME/nix-config"; };
};
stylix = {
enable = true;
base16Scheme = "${pkgs.base16-schemes}/share/themes/catppuccin-mocha.yaml";
image = pkgs.fetchurl {
url = "https://lds-img.finalfantasyxiv.com/h/d/gGA_a8kMXpsxZEOfW_MadG07_E.jpg";
url =
"https://lds-img.finalfantasyxiv.com/h/d/gGA_a8kMXpsxZEOfW_MadG07_E.jpg";
sha256 = "0d8b4031dnlrcd3wx63p19w5h5zc8z5fk2yqz0wv20m7gr62h8r0";
};
fonts = {

View file

@ -1,6 +1 @@
{ ... }: {
imports = [
./global.nix
./features/desktop/font.nix
];
}
{ ... }: { imports = [ ./global.nix ./features/desktop/font.nix ]; }

View file

@ -1,8 +1,4 @@
{
lib,
config,
...
}:
{ lib, config, ... }:
let
mkFontOption = kind: {
family = lib.mkOption {
@ -19,8 +15,7 @@ let
};
};
cfg = config.fontProfiles;
in
{
in {
options.fontProfiles = {
enable = lib.mkEnableOption "Whether to enable font profiles";
monospace = mkFontOption "monospace";
@ -30,10 +25,7 @@ in
config = lib.mkIf cfg.enable {
fonts.fontconfig.enable = true;
home.packages = [
cfg.monospace.package
cfg.regular.package
cfg.bitmap.package
];
home.packages =
[ cfg.monospace.package cfg.regular.package cfg.bitmap.package ];
};
}

View file

@ -1,65 +1,54 @@
{
lib,
config,
...
}:
let
inherit (lib) mkOption types;
in
{
{ lib, config, ... }:
let inherit (lib) mkOption types;
in {
options.monitors = mkOption {
type = types.listOf (
types.submodule {
options = {
name = mkOption {
type = types.str;
example = "DP-1";
};
primary = mkOption {
type = types.bool;
default = false;
};
width = mkOption {
type = types.int;
example = 1920;
};
height = mkOption {
type = types.int;
example = 1080;
};
refreshRate = mkOption {
type = types.int;
default = 60;
};
position = mkOption {
type = types.str;
default = "auto";
};
enabled = mkOption {
type = types.bool;
default = true;
};
workspace = mkOption {
type = types.nullOr types.str;
default = null;
};
scale = mkOption {
type = types.nullOr types.str;
default = "1";
};
type = types.listOf (types.submodule {
options = {
name = mkOption {
type = types.str;
example = "DP-1";
};
}
);
primary = mkOption {
type = types.bool;
default = false;
};
width = mkOption {
type = types.int;
example = 1920;
};
height = mkOption {
type = types.int;
example = 1080;
};
refreshRate = mkOption {
type = types.int;
default = 60;
};
position = mkOption {
type = types.str;
default = "auto";
};
enabled = mkOption {
type = types.bool;
default = true;
};
workspace = mkOption {
type = types.nullOr types.str;
default = null;
};
scale = mkOption {
type = types.nullOr types.str;
default = "1";
};
};
});
default = [ ];
};
config = {
assertions = [
{
assertion =
((lib.length config.monitors) != 0)
-> ((lib.length (lib.filter (m: m.primary) config.monitors)) == 1);
message = "Exactly one monitor must be set to primary.";
}
];
assertions = [{
assertion = ((lib.length config.monitors) != 0)
-> ((lib.length (lib.filter (m: m.primary) config.monitors)) == 1);
message = "Exactly one monitor must be set to primary.";
}];
};
}

View file

@ -1,5 +1,4 @@
{ pkgs, ... }:
{
{ pkgs, ... }: {
security.rtkit.enable = true;
services.pipewire = {
enable = true;
@ -8,7 +7,5 @@
pulse.enable = true;
wireplumber.enable = true;
};
environment.systemPackages = with pkgs; [
pavucontrol
];
environment.systemPackages = with pkgs; [ pavucontrol ];
}

View file

@ -1,6 +1 @@
{ ... }:
{
hardware.bluetooth = {
enable = true;
};
}
{ ... }: { hardware.bluetooth = { enable = true; }; }

View file

@ -1,11 +1,5 @@
{ lib, pkgs, ... }:
{
imports = [
./audio.nix
./tailscale.nix
./bluetooth.nix
./printing.nix
];
{ lib, pkgs, ... }: {
imports = [ ./audio.nix ./tailscale.nix ./bluetooth.nix ./printing.nix ];
# use nix version 2.22
nix = {
@ -13,11 +7,7 @@
settings = {
auto-optimise-store = lib.mkDefault true;
experimental-features = [
"nix-command"
"flakes"
"ca-derivations"
];
experimental-features = [ "nix-command" "flakes" "ca-derivations" ];
};
};
@ -33,9 +23,7 @@
# use a tmpfs
boot.tmp.useTmpfs = true;
systemd.services.nix-daemon = {
environment.TMPDIR = "/var/tmp";
};
systemd.services.nix-daemon = { environment.TMPDIR = "/var/tmp"; };
# use fstrim for ssds
services.fstrim.enable = true;

View file

@ -1,5 +1,4 @@
{ ... }:
{
{ ... }: {
services.printing.enable = true;
services.avahi = {

View file

@ -1,6 +1 @@
{ ... }:
{
services.tailscale = {
enable = true;
};
}
{ ... }: { services.tailscale = { enable = true; }; }

View file

@ -1,7 +1 @@
{ ... }:
{
imports = [
./steam.nix
./flatpak.nix
];
}
{ ... }: { imports = [ ./steam.nix ./flatpak.nix ]; }

View file

@ -1,4 +1 @@
{ ... }:
{
services.flatpak.enable = true;
}
{ ... }: { services.flatpak.enable = true; }

View file

@ -1,5 +1,4 @@
{ ... }:
{
{ ... }: {
security.pam.services.swaylock = { };
services.blueman.enable = true;
}

View file

@ -1,5 +1,4 @@
{ pkgs, ... }:
{
{ pkgs, ... }: {
services.displayManager.sddm.enable = true;
services.displayManager.sddm.wayland.enable = true;
services.desktopManager.plasma6.enable = true;

View file

@ -1,5 +1,4 @@
{ ... }:
{
{ ... }: {
programs.steam = {
enable = true;
remotePlay.openFirewall = true;

View file

@ -1,10 +1,4 @@
{ inputs
, lib
, config
, pkgs
, ...
}:
{
{ inputs, lib, config, pkgs, ... }: {
imports = [
../common
./hardware-configuration.nix
@ -12,27 +6,20 @@
../desktop/plasma.nix
];
nixpkgs = {
config = {
allowUnfree = true;
nixpkgs = { config = { allowUnfree = true; }; };
nix = let flakeInputs = lib.filterAttrs (_: lib.isType "flake") inputs;
in {
settings = {
flake-registry = "";
nix-path = config.nix.nixPath;
};
channel.enable = false;
registry = lib.mapAttrs (_: flake: { inherit flake; }) flakeInputs;
nixPath = lib.mapAttrsToList (n: _: "${n}=flake:${n}") flakeInputs;
};
nix =
let
flakeInputs = lib.filterAttrs (_: lib.isType "flake") inputs;
in
{
settings = {
flake-registry = "";
nix-path = config.nix.nixPath;
};
channel.enable = false;
registry = lib.mapAttrs (_: flake: { inherit flake; }) flakeInputs;
nixPath = lib.mapAttrsToList (n: _: "${n}=flake:${n}") flakeInputs;
};
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
@ -64,17 +51,12 @@
lu = {
shell = pkgs.fish;
isNormalUser = true;
extraGroups = [
"wheel"
"storage"
];
extraGroups = [ "wheel" "storage" ];
};
};
# network stuff
networking.networkmanager = {
enable = true;
};
networking.networkmanager = { enable = true; };
# fish shell
programs.fish = {
@ -89,9 +71,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";

View file

@ -1,25 +1,13 @@
# 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 = [ ];
@ -32,10 +20,7 @@
fileSystems."/boot" = {
device = "/dev/disk/by-uuid/6157-ADC8";
fsType = "vfat";
options = [
"fmask=0022"
"dmask=0022"
];
options = [ "fmask=0022" "dmask=0022" ];
};
swapDevices = [ ];
@ -48,5 +33,6 @@
# networking.interfaces.wlp1s0.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
hardware.cpu.amd.updateMicrocode =
lib.mkDefault config.hardware.enableRedistributableFirmware;
}

View file

@ -1,15 +1,10 @@
{ ... }:
{
{ ... }: {
services.postgresql = {
enable = true;
ensureUsers = [
{
name = "lu";
ensureClauses = {
superuser = true;
};
}
];
ensureUsers = [{
name = "lu";
ensureClauses = { superuser = true; };
}];
};
}

View file

@ -1,27 +1,13 @@
# 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 = [ ];
@ -34,15 +20,11 @@
fileSystems."/boot" = {
device = "/dev/disk/by-uuid/5704-1642";
fsType = "vfat";
options = [
"fmask=0077"
"dmask=0077"
];
options = [ "fmask=0077" "dmask=0077" ];
};
swapDevices = [
{ device = "/dev/disk/by-uuid/d52209e9-f625-46a9-800a-88598ed6fcd5"; }
];
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
@ -53,5 +35,6 @@
# networking.interfaces.wlp6s0.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
hardware.cpu.intel.updateMicrocode =
lib.mkDefault config.hardware.enableRedistributableFirmware;
}

View file

@ -1,6 +1,5 @@
# This file defines overlays
{ inputs, ... }:
{
{ inputs, ... }: {
# This one brings our custom packages from the 'pkgs' directory
additions = final: _prev: import ../pkgs final.pkgs;
@ -10,17 +9,18 @@
modifications = final: prev: {
zed-editor = final.callPackage prev.zed-editor.override {
rustPlatform = final.rustPlatform // {
buildRustPackage = args: final.rustPlatform.buildRustPackage (args // {
patches = (args.patches or [ ] ++ [
./zed-use-custom-cosmic-text.patch
]);
cargoLock = {
lockFile = ./zed.Cargo.lock;
outputHashes = args.cargoLock.outputHashes // {
"cosmic-text-0.11.2" = "sha256-ld9mrvtZIEftenn1D5IuXFQikJU2GAil6MCsrIh9o14=";
buildRustPackage = args:
final.rustPlatform.buildRustPackage (args // {
patches =
(args.patches or [ ] ++ [ ./zed-use-custom-cosmic-text.patch ]);
cargoLock = {
lockFile = ./zed.Cargo.lock;
outputHashes = args.cargoLock.outputHashes // {
"cosmic-text-0.11.2" =
"sha256-ld9mrvtZIEftenn1D5IuXFQikJU2GAil6MCsrIh9o14=";
};
};
};
});
});
};
};
};

View file

@ -1,5 +1,6 @@
# Custom packages, that can be defined similarly to ones from nixpkgs
# You can build them using 'nix build .#example'
pkgs: {
pkgs:
{
# example = pkgs.callPackage ./example { };
}

View file

@ -3,27 +3,24 @@
inputs.deploy-rs.url = "github:serokell/deploy-rs";
outputs =
{ self
, nixpkgs
, deploy-rs
,
}:
{
nixosConfigurations.lunasa = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [ ./lunasa/configuration.nix ];
};
deploy.nodes.lunasa = {
hostname = "lunasa";
sshUser = "root";
profiles.system = {
user = "root";
path = deploy-rs.lib.x86_64-linux.activate.nixos self.nixosConfigurations.lunasa;
};
};
checks = builtins.mapAttrs (system: deployLib: deployLib.deployChecks self.deploy) deploy-rs.lib;
outputs = { self, nixpkgs, deploy-rs, }: {
nixosConfigurations.lunasa = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [ ./lunasa/configuration.nix ];
};
deploy.nodes.lunasa = {
hostname = "lunasa";
sshUser = "root";
profiles.system = {
user = "root";
path = deploy-rs.lib.x86_64-linux.activate.nixos
self.nixosConfigurations.lunasa;
};
};
checks =
builtins.mapAttrs (system: deployLib: deployLib.deployChecks self.deploy)
deploy-rs.lib;
};
}

View file

@ -1,5 +1,4 @@
{ modulesPath, pkgs, lib, ... }:
{
{ modulesPath, pkgs, lib, ... }: {
imports = [ (modulesPath + "/profiles/qemu-guest.nix") ];
networking.hostName = "lunasa";
@ -7,12 +6,8 @@
services.openssh.enable = true;
boot.tmp.cleanOnBoot = true;
boot.loader.grub.device = "/dev/sda";
boot.initrd.availableKernelModules = [
"ata_piix"
"uhci_hcd"
"xen_blkfront"
"vmw_pvscsi"
];
boot.initrd.availableKernelModules =
[ "ata_piix" "uhci_hcd" "xen_blkfront" "vmw_pvscsi" ];
boot.initrd.kernelModules = [ "nvme" ];
fileSystems."/" = {
device = "/dev/sda1";
@ -24,17 +19,13 @@
settings = {
auto-optimise-store = lib.mkDefault true;
experimental-features = [
"nix-command"
"flakes"
"ca-derivations"
];
experimental-features = [ "nix-command" "flakes" "ca-derivations" ];
};
};
users.users.root.openssh.authorizedKeys.keys = [
''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKoDv47WF/WGsIn47xdmkNeScQSF3yTzLhaZoR+kFUJy''
''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOXWOPpEDdVUQEFLucXbxmOhW64QXbCu6lF8vRLlKyoT''
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKoDv47WF/WGsIn47xdmkNeScQSF3yTzLhaZoR+kFUJy"
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOXWOPpEDdVUQEFLucXbxmOhW64QXbCu6lF8vRLlKyoT"
];
networking.firewall.allowedTCPPorts = [
@ -64,9 +55,7 @@
registration = {
allow-before-connect = true;
bcrypt-cost = 4;
email-verification = {
enabled = false;
};
email-verification = { enabled = false; };
enabled = true;
throttling = {
duration = "10m";
@ -77,9 +66,7 @@
};
channels = {
default-modes = "+ntC";
registration = {
enabled = true;
};
registration = { enabled = true; };
};
datastore = {
autoupgrade = true;
@ -103,10 +90,7 @@
};
tagmsg-storage = {
default = false;
whitelist = [
"+draft/react"
"+react"
];
whitelist = [ "+draft/react" "+react" ];
};
znc-maxmessages = 2048;
};
@ -118,34 +102,26 @@
nicklen = 32;
topiclen = 390;
};
network = {
name = "linacastellane";
};
network = { name = "linacastellane"; };
server = {
casemapping = "permissive";
check-ident = false;
enforce-utf = true;
enforce-utf8 = true;
forward-confirm-hostnames = false;
ip-cloaking = {
enabled = false;
};
ip-cloaking = { enabled = false; };
ip-limits = {
count = false;
throttle = false;
};
listeners = {
":6667" = { };
"127.0.0.1:8067" = {
websocket = true;
};
"127.0.0.1:8067" = { websocket = true; };
};
lookup-hostnames = false;
max-sendq = "1M";
name = "chat.lina.cool";
relaymsg = {
enabled = false;
};
relaymsg = { enabled = false; };
};
oper-classes = {
"chat-moderator" = {
@ -165,20 +141,15 @@
"server-admin" = {
title = "Server Admin";
extends = "chat-moderator";
capabilities = [
"rehash"
"accreg"
"chanreg"
"history"
"defcon"
"massmessage"
];
capabilities =
[ "rehash" "accreg" "chanreg" "history" "defcon" "massmessage" ];
};
};
opers = {
admin = {
class = "server-admin";
password = "$2a$04$uSnmJ2i4AVYR.z/kpCirsuNQGpFLUzsmIogK6qvc9mvf8UMDKjTPG";
password =
"$2a$04$uSnmJ2i4AVYR.z/kpCirsuNQGpFLUzsmIogK6qvc9mvf8UMDKjTPG";
};
};
};
@ -222,13 +193,11 @@
enable = true;
internalInterfaces = [ "enp1s0" ];
externalInterface = "tailscale0";
forwardPorts = [
{
destination = "100.66.105.22:25565";
proto = "tcp";
sourcePort = 25565;
}
];
forwardPorts = [{
destination = "100.66.105.22:25565";
proto = "tcp";
sourcePort = 25565;
}];
};
system.stateVersion = "23.11";

View file

@ -1,23 +1,14 @@
# 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; [
home-manager
git
nh
];
nativeBuildInputs = with pkgs; [ home-manager git nh ];
};
}