Update a lot of options, simplify variables, replace options with tags
This commit is contained in:
parent
dbc0ab6dd3
commit
7667ef9a1b
147 changed files with 663 additions and 928 deletions
|
@ -9,5 +9,5 @@
|
|||
./wms
|
||||
];
|
||||
|
||||
config.home.stateVersion = "24.11";
|
||||
config.home.stateVersion = "25.05";
|
||||
}
|
||||
|
|
|
@ -6,11 +6,11 @@
|
|||
settings = {
|
||||
main = {
|
||||
term = "xterm-256color";
|
||||
font = "${config.look.fonts.mono}:size=14.7";
|
||||
font = "${config.vars.fonts.mono}:size=14.7";
|
||||
};
|
||||
colors = {
|
||||
alpha = "0.85";
|
||||
background = config.look.colors.dark;
|
||||
background = config.vars.colors.dark;
|
||||
regular0 = "3f3f3f";
|
||||
regular1 = "cc0000";
|
||||
regular2 = "4e9a06";
|
||||
|
@ -29,7 +29,10 @@
|
|||
bright7 = "ffffff";
|
||||
};
|
||||
cursor.style = "beam";
|
||||
key-bindings.search-start = "Control+f";
|
||||
key-bindings = {
|
||||
search-start = "Control+f";
|
||||
show-urls-launch = "Control+s";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
@ -146,9 +146,9 @@
|
|||
"webgl.disabled" = false;
|
||||
|
||||
# Fonts
|
||||
"font.name.monospace.x-western" = config.look.fonts.mono;
|
||||
"font.name.sans-serif.x-western" = config.look.fonts.main;
|
||||
"font.name.serif.x-western" = config.look.fonts.main;
|
||||
"font.name.monospace.x-western" = config.vars.fonts.mono;
|
||||
"font.name.sans-serif.x-western" = config.vars.fonts.main;
|
||||
"font.name.serif.x-western" = config.vars.fonts.main;
|
||||
|
||||
# Theming and visibility
|
||||
"browser.aboutConfig.showWarning" = false;
|
||||
|
@ -235,16 +235,16 @@
|
|||
|
||||
userChrome = ''
|
||||
:root {
|
||||
--tab-active-bg-color: #${config.look.colors.prime};
|
||||
--tab-hover-bg-color: #${config.look.colors.accent};
|
||||
--tab-inactive-bg-color: #${config.look.colors.dark};
|
||||
--tab-active-bg-color: #${config.vars.colors.prime};
|
||||
--tab-hover-bg-color: #${config.vars.colors.accent};
|
||||
--tab-inactive-bg-color: #${config.vars.colors.dark};
|
||||
--tab-active-fg-fallback-color: #FFFFFF;
|
||||
--tab-inactive-fg-fallback-color: #${config.look.colors.text};
|
||||
--urlbar-focused-bg-color: #${config.look.colors.dark};
|
||||
--urlbar-not-focused-bg-color: #${config.look.colors.dark};
|
||||
--toolbar-bgcolor: #${config.look.colors.dark} !important;
|
||||
--tab-font: '${config.look.fonts.main}';
|
||||
--urlbar-font: '${config.look.fonts.main}';
|
||||
--tab-inactive-fg-fallback-color: #${config.vars.colors.text};
|
||||
--urlbar-focused-bg-color: #${config.vars.colors.dark};
|
||||
--urlbar-not-focused-bg-color: #${config.vars.colors.dark};
|
||||
--toolbar-bgcolor: #${config.vars.colors.dark} !important;
|
||||
--tab-font: '${config.vars.fonts.main}';
|
||||
--urlbar-font: '${config.vars.fonts.main}';
|
||||
${builtins.readFile ./quteFox.css}
|
||||
'';
|
||||
};
|
||||
|
|
|
@ -92,8 +92,8 @@
|
|||
let g:airline_theme='onedark'
|
||||
let g:airline#extensions#tabline#enabled = 1
|
||||
hi Normal guibg=none
|
||||
hi Visual guibg=#${config.look.colors.mid}
|
||||
hi Pmenu guibg=#${config.look.colors.mid}
|
||||
hi Visual guibg=#${config.vars.colors.mid}
|
||||
hi Pmenu guibg=#${config.vars.colors.mid}
|
||||
hi EndOfBuffer guibg=none
|
||||
hi LineNr guibg=none
|
||||
lua require'colorizer'.setup()
|
||||
|
|
|
@ -3,8 +3,8 @@
|
|||
fonts.fontconfig = {
|
||||
enable = config.home.desktop.enable;
|
||||
defaultFonts = {
|
||||
sansSerif = [ config.look.fonts.main ];
|
||||
monospace = [ config.look.fonts.mono ];
|
||||
sansSerif = [ config.vars.fonts.main ];
|
||||
monospace = [ config.vars.fonts.mono ];
|
||||
emoji = [ "Twitter Color Emoji" ];
|
||||
};
|
||||
};
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
{
|
||||
gtk = with pkgs; {
|
||||
font = {
|
||||
name = config.look.fonts.main;
|
||||
name = config.vars.fonts.main;
|
||||
size = 11;
|
||||
};
|
||||
theme = {
|
||||
|
@ -21,7 +21,7 @@
|
|||
iconTheme = {
|
||||
name = "Papirus-Dark";
|
||||
package = papirus-icon-theme.override {
|
||||
color = config.look.colors.folder;
|
||||
color = config.vars.colors.folder;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
|
@ -1,9 +1,6 @@
|
|||
{ config, ... }:
|
||||
{
|
||||
imports = [
|
||||
./defaults
|
||||
./folders
|
||||
];
|
||||
imports = [ ./dirs ];
|
||||
|
||||
xdg.enable = config.home.desktop.enable;
|
||||
|
||||
|
|
|
@ -1,21 +0,0 @@
|
|||
{ config, ... }:
|
||||
{
|
||||
xdg.mimeApps = {
|
||||
enable = config.xdg.enable;
|
||||
defaultApplications = {
|
||||
# Media
|
||||
"image/*" = [ "imv.desktop" ];
|
||||
"image/gif" = [ "mpv.desktop" ];
|
||||
"video/*" = [ "mpv.desktop" ];
|
||||
|
||||
# Apps
|
||||
"inode/directory" = [ "pcmanfm-qt.desktop" ];
|
||||
"text/plain" = [ "nvim.desktop" ];
|
||||
|
||||
# Browser
|
||||
"application/x-mswinurl" = [ "librewolf.desktop" ];
|
||||
"x-scheme-handler/http" = [ "librewolf.desktop" ];
|
||||
"x-scheme-handler/https" = [ "librewolf.desktop" ];
|
||||
};
|
||||
};
|
||||
}
|
|
@ -13,7 +13,7 @@
|
|||
extraConfig = {
|
||||
XDG_GAMES_DIR = "${homeDirectory}/Games";
|
||||
XDG_KEEPERS_DIR = "${homeDirectory}/Keepers";
|
||||
XDG_NETWORK_DIR = "${homeDirectory}/Network";
|
||||
XDG_NETWORK_DIR = "/network";
|
||||
XDG_PERSIST_DIR = "/persist${homeDirectory}";
|
||||
XDG_PROJECTS_DIR = "${homeDirectory}/Projects";
|
||||
XDG_SCREENSHOTS_DIR = "${config.xdg.userDirs.pictures}/Screenshots";
|
|
@ -1,6 +1,6 @@
|
|||
{ ... }:
|
||||
{
|
||||
look.border = rec {
|
||||
vars.border = rec {
|
||||
int = 3;
|
||||
string = toString int;
|
||||
};
|
|
@ -1,6 +1,6 @@
|
|||
{ ... }:
|
||||
{
|
||||
look.colors = {
|
||||
vars.colors = {
|
||||
prime = "3823C4"; #3823C4
|
||||
accent = "1B1F59"; #1B1F59
|
||||
split = "555B9E"; #555B9E
|
|
@ -1,8 +1,14 @@
|
|||
{ ... }:
|
||||
{ lib, ... }:
|
||||
{
|
||||
imports = [
|
||||
./border
|
||||
./colors
|
||||
./displays
|
||||
./look
|
||||
./fonts
|
||||
./workspaces
|
||||
];
|
||||
|
||||
options.vars = lib.mkOption {
|
||||
type = lib.types.attrs;
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,10 +1,6 @@
|
|||
{ config, lib, ... }:
|
||||
{ ... }:
|
||||
{
|
||||
options.displays = lib.mkOption {
|
||||
type = lib.types.attrs;
|
||||
};
|
||||
|
||||
config.displays = {
|
||||
vars.displays = {
|
||||
tower1 = "Microstep MSI G24C 0000000000001";
|
||||
tower2 = "BNQ BenQ GW2270 6CH00781019";
|
||||
tower3 = "Eizo Nanao Corporation CG223W 23252050";
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{ ... }:
|
||||
{
|
||||
look.fonts = {
|
||||
vars.fonts = {
|
||||
main = "Ubuntu Nerd Font";
|
||||
mono = "UbuntuMono Nerd Font";
|
||||
};
|
|
@ -1,12 +0,0 @@
|
|||
{ config, lib, ... }:
|
||||
{
|
||||
imports = [
|
||||
./border
|
||||
./colors
|
||||
./fonts
|
||||
];
|
||||
|
||||
options.look = lib.mkOption {
|
||||
type = lib.types.attrs;
|
||||
};
|
||||
}
|
|
@ -1,10 +1,6 @@
|
|||
{ config, lib, ... }:
|
||||
{ ... }:
|
||||
{
|
||||
options.ws = lib.mkOption {
|
||||
type = lib.types.attrs;
|
||||
};
|
||||
|
||||
config.ws = {
|
||||
vars.ws = {
|
||||
w0 = "0";
|
||||
w1 = "1";
|
||||
w2 = "2";
|
||||
|
|
|
@ -2,11 +2,11 @@
|
|||
{
|
||||
services.kanshi = {
|
||||
enable = config.home.desktop.enable;
|
||||
settings = [
|
||||
settings = with config.vars.displays; [
|
||||
# Outputs
|
||||
{
|
||||
output = {
|
||||
criteria = config.displays.tower1;
|
||||
criteria = tower1;
|
||||
adaptiveSync = true;
|
||||
mode = "1920x1080@143.979996Hz";
|
||||
};
|
||||
|
@ -18,20 +18,20 @@
|
|||
name = "tower-tv";
|
||||
outputs = [
|
||||
{
|
||||
criteria = config.displays.tower1;
|
||||
criteria = tower1;
|
||||
position = "3840,405";
|
||||
}
|
||||
{
|
||||
criteria = config.displays.tower2;
|
||||
criteria = tower2;
|
||||
position = "1920,405";
|
||||
}
|
||||
{
|
||||
criteria = config.displays.tower3;
|
||||
criteria = tower3;
|
||||
position = "5760,0";
|
||||
transform = "90";
|
||||
}
|
||||
{
|
||||
criteria = config.displays.tower4;
|
||||
criteria = tower4;
|
||||
position = "0,405";
|
||||
}
|
||||
];
|
||||
|
@ -42,15 +42,15 @@
|
|||
name = "tower";
|
||||
outputs = [
|
||||
{
|
||||
criteria = config.displays.tower1;
|
||||
criteria = tower1;
|
||||
position = "1920,405";
|
||||
}
|
||||
{
|
||||
criteria = config.displays.tower2;
|
||||
criteria = tower2;
|
||||
position = "0,405";
|
||||
}
|
||||
{
|
||||
criteria = config.displays.tower3;
|
||||
criteria = tower3;
|
||||
position = "3840,0";
|
||||
transform = "90";
|
||||
}
|
||||
|
@ -63,11 +63,11 @@
|
|||
name = "detritus";
|
||||
outputs = [
|
||||
{
|
||||
criteria = config.displays.detritus1;
|
||||
criteria = detritus1;
|
||||
position = "0,0";
|
||||
}
|
||||
{
|
||||
criteria = config.displays.detritus2;
|
||||
criteria = detritus2;
|
||||
position = "1920,0";
|
||||
scale = 0.85;
|
||||
}
|
||||
|
|
|
@ -4,10 +4,10 @@
|
|||
enable = config.home.desktop.enable;
|
||||
settings = {
|
||||
# Theme
|
||||
background-color = "#${config.look.colors.dark}D9";
|
||||
border-color = "#${config.look.colors.accent}";
|
||||
border-size = config.look.border.int;
|
||||
font = "${config.look.fonts.main} 12";
|
||||
background-color = "#${config.vars.colors.dark}D9";
|
||||
border-color = "#${config.vars.colors.accent}";
|
||||
border-size = config.vars.border.int;
|
||||
font = "${config.vars.fonts.main} 12";
|
||||
margin = 0;
|
||||
max-icon-size = 40;
|
||||
outer-margin = 10;
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
enable = true;
|
||||
package = pkgs.rofi-wayland;
|
||||
terminal = "foot";
|
||||
font = "${config.look.fonts.main} 14";
|
||||
font = "${config.vars.fonts.main} 14";
|
||||
theme = let
|
||||
inherit (config.lib.formats.rasi) mkLiteral;
|
||||
in {
|
||||
|
@ -18,24 +18,24 @@
|
|||
red = mkLiteral "#DC322F";
|
||||
background-color = mkLiteral "#00000000";
|
||||
separatorcolor = mkLiteral "#00000000";
|
||||
normal-foreground = mkLiteral "#${config.look.colors.text}";
|
||||
normal-background = mkLiteral "#${config.look.colors.dark}1A";
|
||||
urgent-foreground = mkLiteral "#${config.look.colors.urgent}";
|
||||
active-foreground = mkLiteral "#${config.look.colors.split}";
|
||||
selected-active-foreground = mkLiteral "#${config.look.colors.prime}";
|
||||
background = mkLiteral "#${config.look.colors.dark}D9";
|
||||
bordercolor = mkLiteral "#${config.look.colors.prime}";
|
||||
normal-foreground = mkLiteral "#${config.vars.colors.text}";
|
||||
normal-background = mkLiteral "#${config.vars.colors.dark}1A";
|
||||
urgent-foreground = mkLiteral "#${config.vars.colors.urgent}";
|
||||
active-foreground = mkLiteral "#${config.vars.colors.split}";
|
||||
selected-active-foreground = mkLiteral "#${config.vars.colors.prime}";
|
||||
background = mkLiteral "#${config.vars.colors.dark}D9";
|
||||
bordercolor = mkLiteral "#${config.vars.colors.prime}";
|
||||
selected-normal-foreground = mkLiteral "#FFFFFF";
|
||||
selected-normal-background = mkLiteral "#${config.look.colors.prime}80";
|
||||
border-color = mkLiteral "#${config.look.colors.prime}";
|
||||
urgent-background = mkLiteral "#${config.look.colors.accent}26";
|
||||
active-background = mkLiteral "#${config.look.colors.accent}26";
|
||||
selected-active-background = mkLiteral "#${config.look.colors.split}54";
|
||||
selected-normal-background = mkLiteral "#${config.vars.colors.prime}80";
|
||||
border-color = mkLiteral "#${config.vars.colors.prime}";
|
||||
urgent-background = mkLiteral "#${config.vars.colors.accent}26";
|
||||
active-background = mkLiteral "#${config.vars.colors.accent}26";
|
||||
selected-active-background = mkLiteral "#${config.vars.colors.split}54";
|
||||
};
|
||||
"#window" = {
|
||||
background-color = mkLiteral "@background";
|
||||
width = 500;
|
||||
border = mkLiteral "${config.look.border.string}";
|
||||
border = mkLiteral "${config.vars.border.string}";
|
||||
padding = 5;
|
||||
};
|
||||
"#message" = {
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
{ config, pkgs, ... }:
|
||||
let
|
||||
default = "#${config.look.colors.prime}FF";
|
||||
wrong = "#${config.look.colors.split}FF";
|
||||
verifying = "#${config.look.colors.accent}FF";
|
||||
default = "#${config.vars.colors.prime}FF";
|
||||
wrong = "#${config.vars.colors.split}FF";
|
||||
verifying = "#${config.vars.colors.accent}FF";
|
||||
blank = "#00000000";
|
||||
clear = "#FFFFFF22";
|
||||
text = "#FFFFFFFF";
|
||||
|
@ -13,7 +13,7 @@ in {
|
|||
settings = {
|
||||
clock = true;
|
||||
image = ".wallpapers/lock.png";
|
||||
font = config.look.fonts.main;
|
||||
font = config.vars.fonts.main;
|
||||
font-size = 30;
|
||||
timestr = "%I:%M%p";
|
||||
datestr = "%a %b %d %Y";
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
settings = {
|
||||
default.mode = "center";
|
||||
any.path = ".wallpapers/1.png";
|
||||
"${config.displays.tower2}".path = ".wallpapers/2.png";
|
||||
"${config.displays.tower3}".path = ".wallpapers/3.png";
|
||||
"${config.vars.displays.tower2}".path = ".wallpapers/2.png";
|
||||
"${config.vars.displays.tower3}".path = ".wallpapers/3.png";
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
@ -236,9 +236,9 @@
|
|||
position = "top";
|
||||
layer = "top";
|
||||
output = [
|
||||
"!${config.displays.tower2}"
|
||||
"!${config.displays.tower3}"
|
||||
"!${config.displays.detritus2}"
|
||||
"!${config.vars.displays.tower2}"
|
||||
"!${config.vars.displays.tower3}"
|
||||
"!${config.vars.displays.detritus2}"
|
||||
"*"
|
||||
];
|
||||
modules-left = [
|
||||
|
@ -271,9 +271,9 @@
|
|||
position = "top";
|
||||
layer = "top";
|
||||
output = [
|
||||
config.displays.tower2
|
||||
config.displays.tower3
|
||||
config.displays.detritus2
|
||||
config.vars.displays.tower2
|
||||
config.vars.displays.tower3
|
||||
config.vars.displays.detritus2
|
||||
];
|
||||
modules-left = [
|
||||
"sway/workspaces"
|
||||
|
@ -294,12 +294,11 @@
|
|||
border: 0;
|
||||
border-radius: 0;
|
||||
min-height: 0;
|
||||
font-family: ${config.look.fonts.main};
|
||||
font-size: 15.5px;
|
||||
color: #${config.look.colors.text};
|
||||
color: #${config.vars.colors.text};
|
||||
}
|
||||
|
||||
#waybar { background: #${config.look.colors.dark}; }
|
||||
#waybar { background: #${config.vars.colors.dark}; }
|
||||
#network { padding: 0 6px 0 4px; }
|
||||
#gamemode, #scratchpad, #privacy, #tray, #bluetooth { margin: 0 2px 0 2px; }
|
||||
#pulseaudio, #mpris, #custom-notifs, #idle_inhibitor, #custom-weather, #cpu, #memory, #custom-vram, #backlight, #battery, #clock { margin: 0 2px 0 4px; }
|
||||
|
@ -312,15 +311,15 @@
|
|||
min-width: 20px;
|
||||
}
|
||||
#workspaces button.visible, #workspaces button.active {
|
||||
border-bottom: 3px solid #${config.look.colors.prime};
|
||||
background: #${config.look.colors.mid};
|
||||
border-bottom: 3px solid #${config.vars.colors.prime};
|
||||
background: #${config.vars.colors.mid};
|
||||
}
|
||||
#workspaces button.urgent {
|
||||
border-bottom: 3px solid #${config.look.colors.urgent};
|
||||
border-bottom: 3px solid #${config.vars.colors.urgent};
|
||||
}
|
||||
#workspaces button:hover {
|
||||
box-shadow: none;
|
||||
background: #${config.look.colors.light};
|
||||
background: #${config.vars.colors.light};
|
||||
}
|
||||
|
||||
#mpris { border-bottom: 3px solid #ffb066; }
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
in {
|
||||
# Hotkeys
|
||||
modifier = "${primeMod}";
|
||||
keybindings = {
|
||||
keybindings = with config.vars.ws; {
|
||||
## Launchers
|
||||
|
||||
# Browser
|
||||
|
@ -78,50 +78,50 @@
|
|||
"${primeMod}+Shift+r" = ''reload'';
|
||||
|
||||
# Switch to workspaces
|
||||
"${primeMod}+grave" = ''workspace 0:${config.ws.w0}'';
|
||||
"${primeMod}+1" = ''workspace 1:${config.ws.w1}'';
|
||||
"${primeMod}+2" = ''workspace 2:${config.ws.w2}'';
|
||||
"${primeMod}+3" = ''workspace 3:${config.ws.w3}'';
|
||||
"${primeMod}+4" = ''workspace 4:${config.ws.w4}'';
|
||||
"${primeMod}+5" = ''workspace 5:${config.ws.w5}'';
|
||||
"${primeMod}+6" = ''workspace 6:${config.ws.w6}'';
|
||||
"${primeMod}+7" = ''workspace 7:${config.ws.w7}'';
|
||||
"${primeMod}+8" = ''workspace 8:${config.ws.w8}'';
|
||||
"${primeMod}+9" = ''workspace 9:${config.ws.w9}'';
|
||||
"${primeMod}+grave" = ''workspace 0:${w0}'';
|
||||
"${primeMod}+1" = ''workspace 1:${w1}'';
|
||||
"${primeMod}+2" = ''workspace 2:${w2}'';
|
||||
"${primeMod}+3" = ''workspace 3:${w3}'';
|
||||
"${primeMod}+4" = ''workspace 4:${w4}'';
|
||||
"${primeMod}+5" = ''workspace 5:${w5}'';
|
||||
"${primeMod}+6" = ''workspace 6:${w6}'';
|
||||
"${primeMod}+7" = ''workspace 7:${w7}'';
|
||||
"${primeMod}+8" = ''workspace 8:${w8}'';
|
||||
"${primeMod}+9" = ''workspace 9:${w9}'';
|
||||
|
||||
# Switch to alternate workspaces
|
||||
"${secMod}+F1" = ''workspace 11:${config.ws.w1a}'';
|
||||
"${secMod}+F2" = ''workspace 22:${config.ws.w2a}'';
|
||||
"${secMod}+F3" = ''workspace 33:${config.ws.w3a}'';
|
||||
"${secMod}+F4" = ''workspace 44:${config.ws.w4a}'';
|
||||
"${secMod}+F5" = ''workspace 55:${config.ws.w5a}'';
|
||||
"${secMod}+F6" = ''workspace 66:${config.ws.w6a}'';
|
||||
"${secMod}+F7" = ''workspace 77:${config.ws.w7a}'';
|
||||
"${secMod}+F8" = ''workspace 88:${config.ws.w8a}'';
|
||||
"${secMod}+F9" = ''workspace 99:${config.ws.w9a}'';
|
||||
"${secMod}+F1" = ''workspace 11:${w1a}'';
|
||||
"${secMod}+F2" = ''workspace 22:${w2a}'';
|
||||
"${secMod}+F3" = ''workspace 33:${w3a}'';
|
||||
"${secMod}+F4" = ''workspace 44:${w4a}'';
|
||||
"${secMod}+F5" = ''workspace 55:${w5a}'';
|
||||
"${secMod}+F6" = ''workspace 66:${w6a}'';
|
||||
"${secMod}+F7" = ''workspace 77:${w7a}'';
|
||||
"${secMod}+F8" = ''workspace 88:${w8a}'';
|
||||
"${secMod}+F9" = ''workspace 99:${w9a}'';
|
||||
|
||||
# Move window to and focus workspace
|
||||
"${primeMod}+Shift+grave" = ''move container to workspace 0:${config.ws.w0}; workspace 0:${config.ws.w0}'';
|
||||
"${primeMod}+Shift+1" = ''move container to workspace 1:${config.ws.w1}; workspace 1:${config.ws.w1}'';
|
||||
"${primeMod}+Shift+2" = ''move container to workspace 2:${config.ws.w2}; workspace 2:${config.ws.w2}'';
|
||||
"${primeMod}+Shift+3" = ''move container to workspace 3:${config.ws.w3}; workspace 3:${config.ws.w3}'';
|
||||
"${primeMod}+Shift+4" = ''move container to workspace 4:${config.ws.w4}; workspace 4:${config.ws.w4}'';
|
||||
"${primeMod}+Shift+5" = ''move container to workspace 5:${config.ws.w5}; workspace 5:${config.ws.w5}'';
|
||||
"${primeMod}+Shift+6" = ''move container to workspace 6:${config.ws.w6}; workspace 6:${config.ws.w6}'';
|
||||
"${primeMod}+Shift+7" = ''move container to workspace 7:${config.ws.w7}; workspace 7:${config.ws.w7}'';
|
||||
"${primeMod}+Shift+8" = ''move container to workspace 8:${config.ws.w8}; workspace 8:${config.ws.w8}'';
|
||||
"${primeMod}+Shift+9" = ''move container to workspace 9:${config.ws.w9}; workspace 9:${config.ws.w9}'';
|
||||
"${primeMod}+Shift+grave" = ''move container to workspace 0:${w0}; workspace 0:${w0}'';
|
||||
"${primeMod}+Shift+1" = ''move container to workspace 1:${w1}; workspace 1:${w1}'';
|
||||
"${primeMod}+Shift+2" = ''move container to workspace 2:${w2}; workspace 2:${w2}'';
|
||||
"${primeMod}+Shift+3" = ''move container to workspace 3:${w3}; workspace 3:${w3}'';
|
||||
"${primeMod}+Shift+4" = ''move container to workspace 4:${w4}; workspace 4:${w4}'';
|
||||
"${primeMod}+Shift+5" = ''move container to workspace 5:${w5}; workspace 5:${w5}'';
|
||||
"${primeMod}+Shift+6" = ''move container to workspace 6:${w6}; workspace 6:${w6}'';
|
||||
"${primeMod}+Shift+7" = ''move container to workspace 7:${w7}; workspace 7:${w7}'';
|
||||
"${primeMod}+Shift+8" = ''move container to workspace 8:${w8}; workspace 8:${w8}'';
|
||||
"${primeMod}+Shift+9" = ''move container to workspace 9:${w9}; workspace 9:${w9}'';
|
||||
|
||||
# Move window to and focus alternate workspace
|
||||
"${secMod}+Shift+F1" = ''move container to workspace 11:${config.ws.w1a}; workspace 11:${config.ws.w1a}'';
|
||||
"${secMod}+Shift+F2" = ''move container to workspace 22:${config.ws.w2a}; workspace 22:${config.ws.w2a}'';
|
||||
"${secMod}+Shift+F3" = ''move container to workspace 33:${config.ws.w3a}; workspace 33:${config.ws.w3a}'';
|
||||
"${secMod}+Shift+F4" = ''move container to workspace 44:${config.ws.w4a}; workspace 44:${config.ws.w4a}'';
|
||||
"${secMod}+Shift+F5" = ''move container to workspace 55:${config.ws.w5a}; workspace 55:${config.ws.w5a}'';
|
||||
"${secMod}+Shift+F6" = ''move container to workspace 66:${config.ws.w6a}; workspace 66:${config.ws.w6a}'';
|
||||
"${secMod}+Shift+F7" = ''move container to workspace 77:${config.ws.w7a}; workspace 77:${config.ws.w7a}'';
|
||||
"${secMod}+Shift+F8" = ''move container to workspace 88:${config.ws.w8a}; workspace 88:${config.ws.w8a}'';
|
||||
"${secMod}+Shift+F9" = ''move container to workspace 99:${config.ws.w9a}; workspace 99:${config.ws.w9a}'';
|
||||
"${secMod}+Shift+F1" = ''move container to workspace 11:${w1a}; workspace 11:${w1a}'';
|
||||
"${secMod}+Shift+F2" = ''move container to workspace 22:${w2a}; workspace 22:${w2a}'';
|
||||
"${secMod}+Shift+F3" = ''move container to workspace 33:${w3a}; workspace 33:${w3a}'';
|
||||
"${secMod}+Shift+F4" = ''move container to workspace 44:${w4a}; workspace 44:${w4a}'';
|
||||
"${secMod}+Shift+F5" = ''move container to workspace 55:${w5a}; workspace 55:${w5a}'';
|
||||
"${secMod}+Shift+F6" = ''move container to workspace 66:${w6a}; workspace 66:${w6a}'';
|
||||
"${secMod}+Shift+F7" = ''move container to workspace 77:${w7a}; workspace 77:${w7a}'';
|
||||
"${secMod}+Shift+F8" = ''move container to workspace 88:${w8a}; workspace 88:${w8a}'';
|
||||
"${secMod}+Shift+F9" = ''move container to workspace 99:${w9a}; workspace 99:${w9a}'';
|
||||
|
||||
# Change focused window
|
||||
"${primeMod}+h" = ''focus left'';
|
||||
|
|
|
@ -2,47 +2,42 @@
|
|||
{
|
||||
# Monitors
|
||||
wayland.windowManager.sway.config = {
|
||||
workspaceOutputAssign = let
|
||||
workspaceOutputAssign = with config.vars.ws; with config.vars.displays; let
|
||||
workspaces1 = [
|
||||
"0:${config.ws.w0}"
|
||||
"1:${config.ws.w1}"
|
||||
"2:${config.ws.w2}"
|
||||
"3:${config.ws.w3}"
|
||||
"11:${config.ws.w1a}"
|
||||
"22:${config.ws.w2a}"
|
||||
"33:${config.ws.w3a}"
|
||||
"0:${w0}"
|
||||
"1:${w1}"
|
||||
"2:${w2}"
|
||||
"3:${w3}"
|
||||
"11:${w1a}"
|
||||
"22:${w2a}"
|
||||
"33:${w3a}"
|
||||
];
|
||||
workspaces2 = [
|
||||
"4:${config.ws.w4}"
|
||||
"5:${config.ws.w5}"
|
||||
"6:${config.ws.w6}"
|
||||
"44:${config.ws.w4a}"
|
||||
"55:${config.ws.w5a}"
|
||||
"4:${w4}"
|
||||
"5:${w5}"
|
||||
"6:${w6}"
|
||||
"44:${w4a}"
|
||||
"55:${w5a}"
|
||||
];
|
||||
workspaces3 = [
|
||||
"7:${config.ws.w7}"
|
||||
"8:${config.ws.w8}"
|
||||
"9:${config.ws.w9}"
|
||||
"77:${config.ws.w7a}"
|
||||
"88:${config.ws.w8a}"
|
||||
"7:${w7}"
|
||||
"8:${w8}"
|
||||
"9:${w9}"
|
||||
"77:${w7a}"
|
||||
"88:${w8a}"
|
||||
];
|
||||
workspaces4 = [
|
||||
"66:${config.ws.w6a}"
|
||||
"99:${config.ws.w9a}"
|
||||
"66:${w6a}"
|
||||
"99:${w9a}"
|
||||
];
|
||||
assign = output: workspaces: map (workspace: {
|
||||
inherit workspace;
|
||||
inherit output;
|
||||
}) workspaces;
|
||||
in
|
||||
(assign "${config.displays.tower1}" workspaces1) ++
|
||||
(assign "${config.displays.tower2}" workspaces2) ++
|
||||
(assign "${config.displays.tower3}" workspaces3) ++
|
||||
(assign "${config.displays.tower4}" workspaces4) ++
|
||||
|
||||
(assign "${config.displays.detritus1}" workspaces1) ++
|
||||
(assign "${config.displays.detritus1}" workspaces2) ++
|
||||
(assign "${config.displays.detritus2}" workspaces3) ++
|
||||
(assign "${config.displays.detritus2}" workspaces4);
|
||||
(assign "${tower1}" workspaces1) ++
|
||||
(assign "${tower2}" workspaces2) ++
|
||||
(assign "${tower3}" workspaces3) ++
|
||||
(assign "${tower4}" workspaces4);
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{ config, ... }:
|
||||
{
|
||||
wayland.windowManager.sway.config = {
|
||||
defaultWorkspace = "workspace 1:${config.ws.w1}";
|
||||
wayland.windowManager.sway.config = with config.vars.ws; {
|
||||
defaultWorkspace = "workspace 1:${w1}";
|
||||
|
||||
focus = {
|
||||
mouseWarping = "container";
|
||||
|
@ -34,7 +34,7 @@
|
|||
# Give apps that don't have them borders
|
||||
{
|
||||
criteria = { con_mark = "giveborder"; };
|
||||
command = ''border pixel ${config.look.border.string}'';
|
||||
command = ''border pixel ${config.vars.border.string}'';
|
||||
}
|
||||
{
|
||||
criteria = { class = "steam"; };
|
||||
|
@ -56,22 +56,22 @@
|
|||
};
|
||||
assigns = {
|
||||
# Browser
|
||||
"1:${config.ws.w1}" = [{ app_id = "librewolf"; }];
|
||||
"1:${w1}" = [{ app_id = "librewolf"; }];
|
||||
|
||||
# Communication
|
||||
"7:${config.ws.w7}" = [
|
||||
"7:${w7}" = [
|
||||
{ app_id = "teams-for-linux"; }
|
||||
{ app_id = "vesktop"; }
|
||||
{ class = "vesktop"; }
|
||||
];
|
||||
"9:${config.ws.w9}" = [{ app_id = "thunderbird"; }];
|
||||
"9:${w9}" = [{ app_id = "thunderbird"; }];
|
||||
|
||||
# Etc
|
||||
"2:${config.ws.w2}" = [
|
||||
"2:${w2}" = [
|
||||
{ class = "steam"; }
|
||||
{ app_id = "heroic"; }
|
||||
];
|
||||
"44:${config.ws.w4a}" = [{ app_id = "com.obsproject.Studio"; }];
|
||||
"44:${w4a}" = [{ app_id = "com.obsproject.Studio"; }];
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
@ -3,49 +3,49 @@
|
|||
wayland.windowManager.sway.config = {
|
||||
colors = {
|
||||
focused = {
|
||||
border = "#${config.look.colors.prime}";
|
||||
background = "#${config.look.colors.prime}";
|
||||
border = "#${config.vars.colors.prime}";
|
||||
background = "#${config.vars.colors.prime}";
|
||||
text = "#FFFFFF";
|
||||
indicator = "#${config.look.colors.actSplit}";
|
||||
childBorder = "#${config.look.colors.prime}";
|
||||
indicator = "#${config.vars.colors.actSplit}";
|
||||
childBorder = "#${config.vars.colors.prime}";
|
||||
};
|
||||
focusedInactive = {
|
||||
border = "#${config.look.colors.accent}";
|
||||
background = "#${config.look.colors.accent}";
|
||||
text = "#${config.look.colors.text}";
|
||||
indicator = "#${config.look.colors.split}";
|
||||
childBorder = "#${config.look.colors.accent}";
|
||||
border = "#${config.vars.colors.accent}";
|
||||
background = "#${config.vars.colors.accent}";
|
||||
text = "#${config.vars.colors.text}";
|
||||
indicator = "#${config.vars.colors.split}";
|
||||
childBorder = "#${config.vars.colors.accent}";
|
||||
};
|
||||
unfocused = {
|
||||
border = "#${config.look.colors.dark}";
|
||||
background = "#${config.look.colors.dark}";
|
||||
text = "#${config.look.colors.text}";
|
||||
indicator = "#${config.look.colors.split}";
|
||||
childBorder = "#${config.look.colors.split}";
|
||||
border = "#${config.vars.colors.dark}";
|
||||
background = "#${config.vars.colors.dark}";
|
||||
text = "#${config.vars.colors.text}";
|
||||
indicator = "#${config.vars.colors.split}";
|
||||
childBorder = "#${config.vars.colors.split}";
|
||||
};
|
||||
urgent = {
|
||||
border = "#${config.look.colors.urgent}";
|
||||
background = "#${config.look.colors.urgent}";
|
||||
text = "#${config.look.colors.text}";
|
||||
indicator = "#${config.look.colors.urgent}";
|
||||
childBorder = "#${config.look.colors.urgent}";
|
||||
border = "#${config.vars.colors.urgent}";
|
||||
background = "#${config.vars.colors.urgent}";
|
||||
text = "#${config.vars.colors.text}";
|
||||
indicator = "#${config.vars.colors.urgent}";
|
||||
childBorder = "#${config.vars.colors.urgent}";
|
||||
};
|
||||
};
|
||||
|
||||
bars = [ ];
|
||||
|
||||
fonts = {
|
||||
names = [ config.look.fonts.main ];
|
||||
names = [ config.vars.fonts.main ];
|
||||
size = 10.5;
|
||||
};
|
||||
|
||||
window = {
|
||||
border = config.look.border.int;
|
||||
border = config.vars.border.int;
|
||||
hideEdgeBorders = "smart";
|
||||
};
|
||||
|
||||
floating = {
|
||||
border = config.look.border.int;
|
||||
border = config.vars.border.int;
|
||||
titlebar = false;
|
||||
};
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
{ config, lib, name, ... }:
|
||||
{ config, name, ... }:
|
||||
{
|
||||
imports = [
|
||||
./devices
|
||||
|
@ -7,12 +7,9 @@
|
|||
./services
|
||||
./settings
|
||||
./users
|
||||
./variables
|
||||
];
|
||||
|
||||
options.system = with lib; {
|
||||
desktop.enable = mkEnableOption "Desktop apps and services";
|
||||
server.enable = mkEnableOption "Server apps and services";
|
||||
};
|
||||
|
||||
config.networking.hostName = name;
|
||||
networking.hostName = name;
|
||||
deployment.tags = config.system.nixos.tags;
|
||||
}
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
{ config, ... }:
|
||||
{
|
||||
services.pipewire = {
|
||||
enable = config.system.desktop.enable;
|
||||
wireplumber.extraConfig."wireplumber.settings"."bluetooth.autoswitch-to-headset-profile" = false;
|
||||
enable = builtins.elem "pc" config.system.nixos.tags;
|
||||
alsa = {
|
||||
enable = true;
|
||||
support32Bit = true;
|
||||
};
|
||||
pulse.enable = true;
|
||||
#jack.enable = true;
|
||||
wireplumber.extraConfig."wireplumber.settings"."bluetooth.autoswitch-to-headset-profile" = false;
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
{ config, lib, ... }:
|
||||
{
|
||||
config = lib.mkIf config.system.desktop.enable {
|
||||
config = lib.mkIf (builtins.elem "pc" config.system.nixos.tags) {
|
||||
hardware.bluetooth = {
|
||||
enable = true;
|
||||
settings = {
|
||||
|
@ -8,9 +8,7 @@
|
|||
Policy.AutoEnable = "true";
|
||||
};
|
||||
};
|
||||
environment = {
|
||||
systemPackages = with pkgs; [ bluetui ];
|
||||
persistence."/persist".directories = [ "/var/lib/bluetooth" ];
|
||||
};
|
||||
|
||||
environment.persistence."/persist".directories = [ "/var/lib/bluetooth" ];
|
||||
};
|
||||
}
|
||||
|
|
|
@ -10,7 +10,6 @@
|
|||
|
||||
boot = {
|
||||
kernelPackages = lib.mkDefault pkgs.linuxPackages_latest;
|
||||
kernelParams = [ "nouveau.config=NvGspRm=1" ];
|
||||
blacklistedKernelModules = [ "pcspkr" ];
|
||||
kernel.sysctl = {
|
||||
"vm.max_map_count" = 2147483642;
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
./disks
|
||||
./networking
|
||||
./printing
|
||||
./tlp
|
||||
./udev
|
||||
./video
|
||||
];
|
||||
|
|
|
@ -2,17 +2,20 @@
|
|||
{
|
||||
boot = {
|
||||
supportedFilesystems = {
|
||||
ntfs = config.system.desktop.enable;
|
||||
zfs = config.system.server.enable;
|
||||
ntfs = builtins.elem "pc" config.system.nixos.tags;
|
||||
zfs = builtins.elem "server" config.system.nixos.tags;
|
||||
};
|
||||
swraid = {
|
||||
enable = config.system.server.enable;
|
||||
enable = builtins.elem "server" config.system.nixos.tags;
|
||||
mdadmConf = "MAILADDR contact@nixfox.ca";
|
||||
};
|
||||
};
|
||||
|
||||
services = lib.mkIf config.environment.persistence."/persist".enable {
|
||||
btrfs.autoScrub.enable = true;
|
||||
btrfs.autoScrub = {
|
||||
enable = true;
|
||||
interval = "weekly";
|
||||
};
|
||||
fstrim.enable = true;
|
||||
};
|
||||
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
{ config, ... }:
|
||||
{
|
||||
imports = [
|
||||
./mounts
|
||||
./mycelium
|
||||
./nameservers
|
||||
./wireless
|
||||
|
|
32
modules/system/devices/networking/mounts/default.nix
Normal file
32
modules/system/devices/networking/mounts/default.nix
Normal file
|
@ -0,0 +1,32 @@
|
|||
{ config, lib, nodes, ... }:
|
||||
{
|
||||
fileSystems = let
|
||||
netOpts = [
|
||||
"noauto"
|
||||
"soft"
|
||||
"x-systemd.automount"
|
||||
];
|
||||
in with nodes; {
|
||||
"midas" = {
|
||||
enable = lib.mkDefault false;
|
||||
device = "[${midas.config.deployment.targetHost}]:/storage";
|
||||
mountPoint = "/network/Midas";
|
||||
fsType = "nfs4";
|
||||
options = netOpts;
|
||||
};
|
||||
"kitty" = {
|
||||
enable = lib.mkDefault false;
|
||||
device = "[${kitty.config.deployment.targetHost}]:/storage";
|
||||
mountPoint = "/network/Kitty";
|
||||
fsType = "nfs4";
|
||||
options = netOpts;
|
||||
};
|
||||
"prophet" = {
|
||||
enable = lib.mkDefault false;
|
||||
device = "[${prophet.config.deployment.targetHost}]:/storage";
|
||||
mountPoint = "/network/Prophet";
|
||||
fsType = "nfs4";
|
||||
options = netOpts;
|
||||
};
|
||||
};
|
||||
}
|
|
@ -1,7 +1,7 @@
|
|||
{ config, ... }:
|
||||
{ ... }:
|
||||
{
|
||||
networking.wireless = {
|
||||
enable = config.system.desktop.enable;
|
||||
enable = true;
|
||||
userControlled.enable = true;
|
||||
};
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
{
|
||||
services = {
|
||||
printing = {
|
||||
enable = config.system.desktop.enable;
|
||||
enable = builtins.elem "pc" config.system.nixos.tags;
|
||||
drivers = with pkgs; [ hplip ];
|
||||
};
|
||||
avahi = {
|
||||
|
|
31
modules/system/devices/tlp/default.nix
Normal file
31
modules/system/devices/tlp/default.nix
Normal file
|
@ -0,0 +1,31 @@
|
|||
{ config, ... }:
|
||||
{
|
||||
services.tlp = {
|
||||
enable = true;
|
||||
settings = let
|
||||
leastBat = 80;
|
||||
maxBat = 85;
|
||||
in {
|
||||
# Stop battery charging after threshold
|
||||
START_CHARGE_THRESH_BAT0 = leastBat;
|
||||
STOP_CHARGE_THRESH_BAT0 = maxBat;
|
||||
START_CHARGE_THRESH_BAT1 = leastBat;
|
||||
STOP_CHARGE_THRESH_BAT1 = maxBat;
|
||||
|
||||
# Change CPU energy/performance policy to power
|
||||
CPU_ENERGY_PERF_POLICY_ON_AC = "performance";
|
||||
CPU_ENERGY_PERF_POLICY_ON_BAT = "power";
|
||||
|
||||
# Enable the platform profile low-power
|
||||
PLATFORM_PROFILE_ON_AC = "performance";
|
||||
PLATFORM_PROFILE_ON_BAT = "low-power";
|
||||
|
||||
# Disable turbo boost
|
||||
CPU_BOOST_ON_AC = 1;
|
||||
CPU_BOOST_ON_BAT = 0;
|
||||
|
||||
CPU_HWP_DYN_BOOST_ON_AC = 1;
|
||||
CPU_HWP_DYN_BOOST_ON_BAT = 0;
|
||||
};
|
||||
};
|
||||
}
|
|
@ -1,6 +1,7 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
services.udev.packages = with pkgs; lib.mkIf config.system.desktop.enable [
|
||||
services.udev.packages = with pkgs; [
|
||||
android-udev-rules
|
||||
game-devices-udev-rules
|
||||
];
|
||||
}
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
imports = [ ./nvidia ];
|
||||
|
||||
hardware.graphics = {
|
||||
enable = config.system.desktop.enable;
|
||||
enable = builtins.elem "pc" config.system.nixos.tags;
|
||||
enable32Bit = if config.nixpkgs.hostPlatform.linuxArch == "x86_64" then true else false;
|
||||
extraPackages = with pkgs; [
|
||||
vulkan-loader
|
||||
|
|
|
@ -1,20 +1,18 @@
|
|||
{ config, lib, ... }:
|
||||
{
|
||||
options.system.nvidia.enable = lib.mkEnableOption "Nvidia graphic drivers";
|
||||
config = lib.mkIf (lib.elem "nvidia" config.services.xserver.videoDrivers) {
|
||||
boot.kernelParams = [ "nvidia_drm.fbdev=1" ]; # Framebuffer fixes TTY access
|
||||
|
||||
config = lib.mkIf config.system.nvidia.enable {
|
||||
hardware.nvidia = {
|
||||
modesetting.enable = true;
|
||||
nvidiaSettings = false;
|
||||
open = true;
|
||||
};
|
||||
|
||||
boot.kernelParams = [ "nvidia_drm.fbdev=1" ]; # Framebuffer fixes TTY access
|
||||
|
||||
services.xserver.videoDrivers = [ "nvidia" ];
|
||||
|
||||
nixpkgs.allowUnfreePackages = [ "nvidia-x11" ];
|
||||
|
||||
specialisation.nouveau.configuration.config.system.nvidia.enable = lib.mkForce false;
|
||||
specialisation.nouveau.configuration.config.services.xserver.videoDrivers = lib.mkForce [ "nouveau" ];
|
||||
} // {
|
||||
boot.kernelParams = [ "nouveau.config=NvGspRm=1" ];
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{ config, lib, ... }:
|
||||
{
|
||||
config = lib.mkIf config.system.desktop.enable {
|
||||
config = lib.mkIf (builtins.elem "pc" config.system.nixos.tags) {
|
||||
programs.sway.enable = true;
|
||||
security.pam.services.swaylock = {};
|
||||
};
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{ config, ... }:
|
||||
{
|
||||
programs.gamemode = {
|
||||
enable = config.system.desktop.enable;
|
||||
enable = builtins.elem "pc" config.system.nixos.tags;
|
||||
settings = {
|
||||
general.renice = 10;
|
||||
gpu = {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
{ config, ... }:
|
||||
{ ... }:
|
||||
{
|
||||
programs.udevil.enable = config.system.desktop.enable;
|
||||
programs.udevil.enable = true;
|
||||
}
|
||||
|
|
Binary file not shown.
|
@ -6,7 +6,6 @@
|
|||
./libvirtd
|
||||
./snowflake
|
||||
./ssh
|
||||
./tlp
|
||||
./userborn
|
||||
./vmware
|
||||
];
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
{
|
||||
config = lib.mkIf config.system.desktop.enable {
|
||||
config = lib.mkIf (builtins.elem "pc" config.system.nixos.tags) {
|
||||
services.greetd = {
|
||||
enable = true;
|
||||
settings.default_session.command = lib.mkDefault (lib.strings.concatStringsSep " " [
|
||||
|
|
|
@ -14,13 +14,15 @@
|
|||
};
|
||||
};
|
||||
|
||||
programs.virt-manager.enable = true;
|
||||
|
||||
networking.firewall.trustedInterfaces = [
|
||||
"virbr0"
|
||||
"virbr1"
|
||||
# Isolate devices into more IOMMU groups
|
||||
boot.kernelParams = [
|
||||
"pcie_acs_override=downstream,multifunction"
|
||||
"pci=routeirq"
|
||||
];
|
||||
|
||||
programs.virt-manager.enable = true;
|
||||
|
||||
# Allow looking glass to be accessed by users
|
||||
systemd.tmpfiles.rules = [ "f /dev/shm/looking-glass 0660 - libvirtd -" ];
|
||||
|
||||
environment.persistence."/persist".directories = [ "/var/lib/libvirt" ];
|
||||
|
|
|
@ -1,4 +0,0 @@
|
|||
{ config, ... }:
|
||||
{
|
||||
services.tlp.enable = config.system.desktop.enable;
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
{ config, lib, ... }:
|
||||
{
|
||||
config = lib.mkIf config.services.cloudflare-dyndns.enable {
|
||||
services.cloudflare-dyndns.apiTokenFile = "/var/lib/private/cloudflare-dyndns/key";
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
./forgejo
|
||||
./icecast
|
||||
./jellyfin
|
||||
./lemmy
|
||||
./mailserver
|
||||
./mastodon
|
||||
./matrix
|
||||
|
|
|
@ -8,17 +8,17 @@
|
|||
lfs.enable = true;
|
||||
settings = {
|
||||
server = {
|
||||
DOMAIN = "git.nixfox.ca";
|
||||
ROOT_URL = "https://git.nixfox.ca:443";
|
||||
DOMAIN = "git.${config.vars.mainDomain}";
|
||||
ROOT_URL = "https://git.${config.vars.mainDomain}:443";
|
||||
HTTP_PORT = 3110;
|
||||
SSH_PORT = 2299;
|
||||
START_SSH_SERVER = true;
|
||||
};
|
||||
mailer = {
|
||||
ENABLED = true;
|
||||
SMTP_ADDR = "mx.nixfox.ca";
|
||||
FROM = "NixFox Git <noreply@nixfox.ca>";
|
||||
USER = "noreply@nixfox.ca";
|
||||
SMTP_ADDR = "mx.${config.vars.mainDomain}";
|
||||
FROM = "NixFox Git <noreply@${config.vars.mainDomain}>";
|
||||
USER = "noreply@${config.vars.mainDomain}";
|
||||
PASSWD = config.secrets.mailPass.nixfoxNoReply;
|
||||
PROTOCOL = "smtps";
|
||||
};
|
||||
|
@ -32,7 +32,7 @@
|
|||
|
||||
networking.firewall.allowedTCPPorts = [ 2299 ];
|
||||
|
||||
services.cloudflare-dyndns.domains = [ "git.nixfox.ca" ];
|
||||
services.cloudflare-dyndns.domains = [ "git.${config.vars.mainDomain}" ];
|
||||
|
||||
environment.persistence."/persist".directories = [ "/var/lib/forgejo" ];
|
||||
};
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{ config, lib, ... }:
|
||||
{
|
||||
services.nginx.virtualHosts."git.nixfox.ca" = lib.mkIf config.services.forgejo.enable {
|
||||
services.nginx.virtualHosts."git.${config.vars.mainDomain}" = lib.mkIf config.services.forgejo.enable {
|
||||
enableACME = true;
|
||||
forceSSL = true;
|
||||
locations."/" = {
|
||||
|
|
|
@ -7,9 +7,9 @@
|
|||
|
||||
services.icecast = {
|
||||
listen.port = 73;
|
||||
hostname = "radio.nixfox.ca";
|
||||
hostname = "radio.${config.vars.mainDomain}";
|
||||
admin = {
|
||||
user = config.sysusers.main;
|
||||
user = "admin";
|
||||
password = config.secrets.cast.adminPass;
|
||||
};
|
||||
extraConf = ''
|
||||
|
@ -17,7 +17,7 @@
|
|||
<source-password>${config.secrets.cast.sourcePass}</source-password>
|
||||
</authentication>
|
||||
<location>Canada</location>
|
||||
<admin>contact@nixfox.ca</admin>
|
||||
<admin>contact@${config.vars.mainDomain}</admin>
|
||||
'';
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{ config, lib, ... }:
|
||||
{
|
||||
services.nginx.virtualHosts."radio.nixfox.ca" = lib.mkIf config.services.icecast.enable {
|
||||
services.nginx.virtualHosts."radio.${config.vars.mainDomain}" = lib.mkIf config.services.icecast.enable {
|
||||
enableACME = true;
|
||||
forceSSL = true;
|
||||
locations."/" = {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{ config, lib, ... }:
|
||||
{
|
||||
services.nginx.virtualHosts."jelly.nixfox.ca" = lib.mkIf config.services.jellyfin.enable {
|
||||
services.nginx.virtualHosts."jelly.${config.vars.mainDomain}" = lib.mkIf config.services.jellyfin.enable {
|
||||
enableACME = true;
|
||||
forceSSL = true;
|
||||
locations."/" = {
|
||||
|
|
|
@ -1,22 +0,0 @@
|
|||
{ config, lib, ... }:
|
||||
{
|
||||
imports = [ ./nginx ];
|
||||
|
||||
config = lib.mkIf config.services.lemmy.enable {
|
||||
services.lemmy = lib.mkIf config.services.lemmy.enable {
|
||||
nginx.enable = true;
|
||||
database.createLocally = true;
|
||||
settings = {
|
||||
hostname = "lemmy.nixfox.ca";
|
||||
email = {
|
||||
smtp_server = "mx.nixfox.ca:587";
|
||||
smtp_login = "noreply@nixfox.ca";
|
||||
smtp_from_address = "NixFox Lemmy <noreply@nixfox.ca>";
|
||||
smtp_password = config.secrets.mailPass.nixfoxNoReply;
|
||||
tls_type = "starttls";
|
||||
};
|
||||
};
|
||||
};
|
||||
environment.persistence."/persist".directories = [ "/var/lib/postgresql" ];
|
||||
};
|
||||
}
|
|
@ -1,7 +0,0 @@
|
|||
{ config, lib, ... }:
|
||||
{
|
||||
services.nginx.virtualHosts."lemmy.nixfox.ca" = lib.mkIf config.services.lemmy.enable {
|
||||
enableACME = true;
|
||||
forceSSL = true;
|
||||
};
|
||||
}
|
|
@ -1,11 +1,75 @@
|
|||
{ lib, ... }:
|
||||
{ config, lib, pkgs, mailserver, ... }:
|
||||
{
|
||||
imports = [
|
||||
./go-autoconfig
|
||||
./radicale
|
||||
./roundcube
|
||||
./simplenix
|
||||
mailserver.nixosModule
|
||||
];
|
||||
|
||||
options.services.mailserver.enable = lib.mkEnableOption "Simple NixOS Mailserver";
|
||||
config = lib.mkIf config.mailserver.enable {
|
||||
mailserver = {
|
||||
fqdn = "mx.${config.vars.mainDomain}";
|
||||
domains = [
|
||||
"nixfox.ca"
|
||||
"bloxelcom.net"
|
||||
"freecorn1854.win"
|
||||
"lunamoonlight.xyz"
|
||||
];
|
||||
certificateScheme = "acme-nginx";
|
||||
localDnsResolver = false;
|
||||
redis.port = 1515;
|
||||
|
||||
# Passwords made with 'mkpasswd -sm bcrypt'
|
||||
loginAccounts = {
|
||||
"jimbo@nixfox.ca" = {
|
||||
hashedPassword = config.secrets.mailHash.bun;
|
||||
aliases = [
|
||||
"james@nixfox.ca"
|
||||
|
||||
"bun@nixfox.ca"
|
||||
"bun@bloxelcom.net"
|
||||
|
||||
"contact@nixfox.ca"
|
||||
];
|
||||
};
|
||||
|
||||
"luna@lunamoonlight.xyz" = {
|
||||
hashedPassword = config.secrets.mailHash.luna;
|
||||
aliases = [
|
||||
"luna@bloxelcom.net"
|
||||
"contact@bloxelcom.net"
|
||||
"ibu@bloxelcom.net"
|
||||
];
|
||||
};
|
||||
|
||||
"contact@freecorn1854.win" = {
|
||||
hashedPassword = config.secrets.mailHash.corn;
|
||||
aliases = [ "freecorn@bloxelcom.net" ];
|
||||
};
|
||||
|
||||
# Noreply emails
|
||||
"noreply@nixfox.ca" = {
|
||||
hashedPassword = config.secrets.mailHash.nixfoxNoReply;
|
||||
sendOnly = true;
|
||||
};
|
||||
"noreply@bloxelcom.net" = {
|
||||
hashedPassword = config.secrets.mailHash.bloxelNoReply;
|
||||
sendOnly = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
services = {
|
||||
redis.servers.rspamd.port = config.mailserver.redis.port;
|
||||
cloudflare-dyndns.domains = [ config.mailserver.fqdn ];
|
||||
};
|
||||
|
||||
environment.persistence."/persist".directories = [
|
||||
"/var/vmail"
|
||||
"/var/lib/dovecot"
|
||||
"/var/lib/postfix"
|
||||
"/var/lib/redis-rspamd"
|
||||
];
|
||||
};
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
{
|
||||
imports = [ ./nginx ];
|
||||
|
||||
services = lib.mkIf config.services.mailserver.enable {
|
||||
services = lib.mkIf config.mailserver.enable {
|
||||
go-autoconfig = {
|
||||
enable = true;
|
||||
settings = {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{ config, lib, ... }:
|
||||
{
|
||||
services.nginx.virtualHosts."autoconfig.nixfox.ca" = lib.mkIf config.services.go-autoconfig.enable {
|
||||
services.nginx.virtualHosts."autoconfig.${config.vars.mainDomain}" = lib.mkIf config.services.go-autoconfig.enable {
|
||||
enableACME = true;
|
||||
forceSSL = true;
|
||||
locations."/" = {
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
{
|
||||
imports = [ ./nginx ];
|
||||
|
||||
config = lib.mkIf config.services.mailserver.enable {
|
||||
config = lib.mkIf config.mailserver.enable {
|
||||
services = {
|
||||
radicale = {
|
||||
enable = true;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{ config, lib, ... }:
|
||||
{
|
||||
services.nginx.virtualHosts."cal.nixfox.ca" = lib.mkIf config.services.go-autoconfig.enable {
|
||||
services.nginx.virtualHosts."cal.${config.vars.mainDomain}" = lib.mkIf config.services.radicale.enable {
|
||||
enableACME = true;
|
||||
forceSSL = true;
|
||||
locations."/" = {
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
{ config, lib, ... }:
|
||||
{
|
||||
config = lib.mkIf config.services.mailserver.enable {
|
||||
config = lib.mkIf config.mailserver.enable {
|
||||
services.roundcube = {
|
||||
enable = true;
|
||||
hostName = "mail.nixfox.ca";
|
||||
hostName = "mail.${config.vars.mainDomain}";
|
||||
extraConfig = ''
|
||||
$config['smtp_server'] = "tls://mx.nixfox.ca";
|
||||
$config['smtp_server'] = "tls://mx.${config.vars.mainDomain}";
|
||||
$config['smtp_user'] = "%u";
|
||||
$config['smtp_pass'] = "%p";
|
||||
'';
|
||||
|
|
|
@ -1,72 +0,0 @@
|
|||
{ config, lib, pkgs, mailserver, ... }:
|
||||
{
|
||||
imports = [ mailserver.nixosModule ];
|
||||
|
||||
config = lib.mkIf config.services.mailserver.enable {
|
||||
mailserver = {
|
||||
enable = true;
|
||||
fqdn = "mx.nixfox.ca";
|
||||
domains = [
|
||||
"nixfox.ca"
|
||||
"bloxelcom.net"
|
||||
"freecorn1854.win"
|
||||
"lunamoonlight.xyz"
|
||||
];
|
||||
certificateScheme = "acme-nginx";
|
||||
localDnsResolver = false;
|
||||
redis.port = 1515;
|
||||
|
||||
# Passwords made with 'mkpasswd -sm bcrypt'
|
||||
loginAccounts = {
|
||||
"jimbo@nixfox.ca" = {
|
||||
hashedPassword = config.secrets.mailHash.bun;
|
||||
aliases = [
|
||||
"james@nixfox.ca"
|
||||
"jimbo@bloxelcom.net"
|
||||
|
||||
"bun@nixfox.ca"
|
||||
"bun@bloxelcom.net"
|
||||
|
||||
"contact@nixfox.ca"
|
||||
];
|
||||
};
|
||||
|
||||
"luna@lunamoonlight.xyz" = {
|
||||
hashedPassword = config.secrets.mailHash.luna;
|
||||
aliases = [
|
||||
"luna@bloxelcom.net"
|
||||
"contact@bloxelcom.net"
|
||||
"ibu@bloxelcom.net"
|
||||
];
|
||||
};
|
||||
|
||||
"contact@freecorn1854.win" = {
|
||||
hashedPassword = config.secrets.mailHash.corn;
|
||||
aliases = [ "freecorn@bloxelcom.net" ];
|
||||
};
|
||||
|
||||
# Noreply emails
|
||||
"noreply@nixfox.ca" = {
|
||||
hashedPassword = config.secrets.mailHash.nixfoxNoReply;
|
||||
sendOnly = true;
|
||||
};
|
||||
"noreply@bloxelcom.net" = {
|
||||
hashedPassword = config.secrets.mailHash.bloxelNoReply;
|
||||
sendOnly = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
services = {
|
||||
redis.servers.rspamd.port = config.mailserver.redis.port;
|
||||
cloudflare-dyndns.domains = [ config.mailserver.fqdn ];
|
||||
};
|
||||
|
||||
environment.persistence."/persist".directories = [
|
||||
"/var/vmail"
|
||||
"/var/lib/dovecot"
|
||||
"/var/lib/postfix"
|
||||
"/var/lib/redis-rspamd"
|
||||
];
|
||||
};
|
||||
}
|
|
@ -12,7 +12,7 @@
|
|||
max-port = 50000;
|
||||
use-auth-secret = true;
|
||||
static-auth-secret = config.secrets.coturnSecret;
|
||||
realm = "turn.nixfox.ca";
|
||||
realm = "turn.${config.vars.mainDomain}";
|
||||
cert = "/var/lib/acme/${config.services.coturn.realm}/fullchain.pem";
|
||||
pkey = "/var/lib/acme/${config.services.coturn.realm}/key.pem";
|
||||
};
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{ config, lib, ... }:
|
||||
{
|
||||
config = lib.mkIf config.services.coturn.enable {
|
||||
services.nginx.virtualHosts."turn.nixfox.ca" = {
|
||||
services.nginx.virtualHosts."turn.${config.vars.mainDomain}" = {
|
||||
enableACME = true;
|
||||
forceSSL = true;
|
||||
listen = [{
|
||||
|
@ -12,11 +12,9 @@
|
|||
locations."/".proxyPass = "http://127.0.0.1:1380";
|
||||
};
|
||||
|
||||
security.acme.certs = {
|
||||
"turn.nixfox.ca" = {
|
||||
group = "turnserver";
|
||||
postRun = "systemctl restart coturn.service";
|
||||
};
|
||||
security.acme.certs."turn.${config.vars.mainDomain}" = {
|
||||
group = "turnserver";
|
||||
postRun = "systemctl restart coturn.service";
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
@ -4,14 +4,14 @@
|
|||
|
||||
nixpkgs.config.element-web.conf = {
|
||||
default_server_config."m.homeserver" = {
|
||||
base_url = "https://matrix.nixfox.ca";
|
||||
server_name = "matrix.nixfox.ca";
|
||||
base_url = "https://matrix.${config.vars.mainDomain}";
|
||||
server_name = "matrix.${config.vars.mainDomain}";
|
||||
};
|
||||
branding = {
|
||||
auth_header_logo_url = "https://www.nixfox.ca/images/copyright/profile.png";
|
||||
#welcome_background_url = "https://www.nixfox.ca/images/backgrounds/template-background.png";
|
||||
auth_header_logo_url = "https://www.${config.vars.mainDomain}/images/copyright/profile.png";
|
||||
#welcome_background_url = "https://www.${config.vars.mainDomain}/images/backgrounds/template-background.png";
|
||||
};
|
||||
embedded_pages.home_url = "https://www.nixfox.ca/";
|
||||
embedded_pages.home_url = "https://www.${config.vars.mainDomain}/";
|
||||
disable_custom_urls = true;
|
||||
disable_guests = true;
|
||||
default_theme = "dark";
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
{
|
||||
services.nginx.virtualHosts."chat.nixfox.ca" = lib.mkIf config.services.matrix-synapse.enable {
|
||||
services.nginx.virtualHosts."chat.${config.vars.mainDomain}" = lib.mkIf config.services.matrix-synapse.enable {
|
||||
enableACME = true;
|
||||
addSSL = true;
|
||||
root = "${pkgs.element-web}";
|
||||
|
|
|
@ -5,15 +5,15 @@
|
|||
config = lib.mkIf config.services.matrix-synapse.enable {
|
||||
services.matrix-synapse = {
|
||||
settings = {
|
||||
server_name = "nixfox.ca";
|
||||
public_baseurl = "https://matrix.nixfox.ca";
|
||||
server_name = "${config.vars.mainDomain}";
|
||||
public_baseurl = "https://matrix.${config.vars.mainDomain}";
|
||||
suppress_key_server_warning = true;
|
||||
|
||||
# Email notifications about account status
|
||||
email = {
|
||||
notif_from = "NixFox Matrix <noreply@nixfox.ca>";
|
||||
smtp_host = "mx.nixfox.ca";
|
||||
smtp_user = "noreply@nixfox.ca";
|
||||
notif_from = "NixFox Matrix <noreply@${config.vars.mainDomain}>";
|
||||
smtp_host = "mx.${config.vars.mainDomain}";
|
||||
smtp_user = "noreply@${config.vars.mainDomain}";
|
||||
smtp_pass = config.secrets.mailPass.nixfoxNoReply;
|
||||
enable_tls = true;
|
||||
smtp_port = 587;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{ config, lib, ... }:
|
||||
{
|
||||
services.nginx.virtualHosts."matrix.nixfox.ca" = lib.mkIf config.services.matrix-synapse.enable {
|
||||
services.nginx.virtualHosts."matrix.${config.vars.mainDomain}" = lib.mkIf config.services.matrix-synapse.enable {
|
||||
enableACME = true;
|
||||
forceSSL = true;
|
||||
locations = {
|
||||
|
|
|
@ -14,6 +14,6 @@
|
|||
symlinks = config.services.minecraft-servers.common.paperSymlinks;
|
||||
files = config.services.minecraft-servers.common.configFiles;
|
||||
};
|
||||
cloudflare-dyndns.domains = lib.mkIf config.services.minecraft-servers.servers.blockworld.enable [ "bloxel.nixfox.ca" ];
|
||||
cloudflare-dyndns.domains = lib.mkIf config.services.minecraft-servers.servers.blockworld.enable [ "bloxel.${config.vars.mainDomain}" ];
|
||||
};
|
||||
}
|
||||
|
|
|
@ -13,6 +13,6 @@
|
|||
symlinks = config.services.minecraft-servers.common.paperSymlinks;
|
||||
files = config.services.minecraft-servers.common.configFiles;
|
||||
};
|
||||
cloudflare-dyndns.domains = lib.mkIf config.services.minecraft-servers.servers.cornworld.enable [ "corn.nixfox.ca" ];
|
||||
cloudflare-dyndns.domains = lib.mkIf config.services.minecraft-servers.servers.cornworld.enable [ "corn.${config.vars.mainDomain}" ];
|
||||
};
|
||||
}
|
||||
|
|
|
@ -6,7 +6,6 @@
|
|||
./dewdemolisher
|
||||
./johnside
|
||||
./marsh
|
||||
./roguecraft
|
||||
./skyblock
|
||||
./uberbeta
|
||||
./velocity
|
||||
|
|
|
@ -13,6 +13,6 @@
|
|||
symlinks = config.services.minecraft-servers.common.paperSymlinks;
|
||||
files = config.services.minecraft-servers.common.configFiles;
|
||||
};
|
||||
cloudflare-dyndns.domains = lib.mkIf config.services.minecraft-servers.servers.dewdemolisher.enable [ "dew.nixfox.ca" ];
|
||||
cloudflare-dyndns.domains = lib.mkIf config.services.minecraft-servers.servers.dewdemolisher.enable [ "dew.${config.vars.mainDomain}" ];
|
||||
};
|
||||
}
|
||||
|
|
|
@ -26,6 +26,6 @@
|
|||
};
|
||||
files = config.services.minecraft-servers.common.configFiles;
|
||||
};
|
||||
cloudflare-dyndns.domains = lib.mkIf config.services.minecraft-servers.servers.johnside.enable [ "john.nixfox.ca" ];
|
||||
cloudflare-dyndns.domains = lib.mkIf config.services.minecraft-servers.servers.johnside.enable [ "john.${config.vars.mainDomain}" ];
|
||||
};
|
||||
}
|
||||
|
|
|
@ -13,6 +13,6 @@
|
|||
symlinks = config.services.minecraft-servers.common.paperSymlinks;
|
||||
files = config.services.minecraft-servers.common.configFiles;
|
||||
};
|
||||
cloudflare-dyndns.domains = lib.mkIf config.services.minecraft-servers.servers.marsh.enable [ "marsh.nixfox.ca" ];
|
||||
cloudflare-dyndns.domains = lib.mkIf config.services.minecraft-servers.servers.marsh.enable [ "marsh.${config.vars.mainDomain}" ];
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,36 +0,0 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
{
|
||||
services = {
|
||||
minecraft-servers.servers.roguecraft = {
|
||||
package = pkgs.paperServers.paper-1_21_1;
|
||||
jvmOpts = "-Xmx3000M";
|
||||
serverProperties = config.services.minecraft-servers.common.serverProperties // {
|
||||
difficulty = 3;
|
||||
server-port = 30014;
|
||||
motd = "\\u00A7l\\u00A7bNixFox \\u00A7cRoguecraft \\u00A7bserver.";
|
||||
require-resource-pack = true;
|
||||
resource-pack = "https://nixfox.ca/roguecraftresourcepackredir";
|
||||
resource-pack-sha1 = "b540c0562aba90c3ead2356bb9cb74fcf0db36b3";
|
||||
};
|
||||
whitelist = config.services.minecraft-servers.common.whitelist;
|
||||
symlinks = config.services.minecraft-servers.common.paperSymlinks;
|
||||
files = config.services.minecraft-servers.common.configFiles // {
|
||||
"world/datapacks/roguecraft.zip" = builtins.fetchurl {
|
||||
url = "https://nixfox.ca/roguecraftdatapackredir";
|
||||
sha256 = "04zrkvzvi1i898al45fh9j3k635sf9qhwca7phbv4ynkfl8bz3q3";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
cloudflare-dyndns.domains = lib.mkIf config.services.minecraft-servers.servers.roguecraft.enable [ "rogue.nixfox.ca" ];
|
||||
|
||||
nginx.virtualHosts."nixfox.ca".locations = lib.mkIf config.services.minecraft-servers.servers.roguecraft.enable {
|
||||
"/roguecraftdatapackredir" = {
|
||||
return = "301 https://cdn.modrinth.com/data/HtKjVijx/versions/Rme4c23R/Roguecraft%201.2.6%20-%20Data%20Pack.zip";
|
||||
};
|
||||
"/roguecraftresourcepackredir" = {
|
||||
return = "301 https://cdn.modrinth.com/data/HtKjVijx/versions/C6bITJnq/Roguecraft%201.2.5.4%20-%20Resource%20Pack.zip";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
|
@ -13,6 +13,6 @@
|
|||
symlinks = config.services.minecraft-servers.common.paperSymlinks;
|
||||
files = config.services.minecraft-servers.common.configFiles;
|
||||
};
|
||||
cloudflare-dyndns.domains = lib.mkIf config.services.minecraft-servers.servers.skyblock.enable [ "skyblock.nixfox.ca" ];
|
||||
cloudflare-dyndns.domains = lib.mkIf config.services.minecraft-servers.servers.skyblock.enable [ "skyblock.${config.vars.mainDomain}" ];
|
||||
};
|
||||
}
|
||||
|
|
|
@ -18,6 +18,6 @@ in {
|
|||
server-port = 30005;
|
||||
};
|
||||
};
|
||||
cloudflare-dyndns.domains = lib.mkIf config.services.minecraft-servers.servers.uberbeta.enable [ "beta.nixfox.ca" ];
|
||||
cloudflare-dyndns.domains = lib.mkIf config.services.minecraft-servers.servers.uberbeta.enable [ "beta.${config.vars.mainDomain}" ];
|
||||
};
|
||||
}
|
||||
|
|
|
@ -8,10 +8,10 @@
|
|||
config = lib.mkIf config.services.nextcloud.enable {
|
||||
services.nextcloud = {
|
||||
package = pkgs.nextcloud31;
|
||||
hostName = "files.nixfox.ca";
|
||||
hostName = "files.${config.vars.mainDomain}";
|
||||
https = true;
|
||||
config = {
|
||||
adminuser = config.sysusers.main;
|
||||
adminuser = "admin";
|
||||
adminpassFile = "${pkgs.writeText "initial" config.secrets.initialPass}";
|
||||
dbtype = "sqlite";
|
||||
};
|
||||
|
@ -19,11 +19,11 @@
|
|||
trusted_proxies = [ "127.0.0.1" ];
|
||||
trusted_domains = [ config.services.nextcloud.hostName ];
|
||||
overwriteprotocol = "https";
|
||||
mail_smtphost = "mx.nixfox.ca";
|
||||
mail_domain = "nixfox.ca";
|
||||
mail_smtphost = "mx.${config.vars.mainDomain}";
|
||||
mail_domain = "${config.vars.mainDomain}";
|
||||
mail_from_address = "noreply";
|
||||
mail_smtpauth = "true";
|
||||
mail_smtpname = "noreply@nixfox.ca";
|
||||
mail_smtpname = "noreply@${config.vars.mainDomain}";
|
||||
mail_smtppassword = config.secrets.mailPass.nixfoxNoReply;
|
||||
mail_smtpmode = "smtp";
|
||||
mail_smtpport = 587;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{ config, lib, ... }:
|
||||
{
|
||||
services.nginx.virtualHosts."files.nixfox.ca" = lib.mkIf config.services.nextcloud.enable {
|
||||
services.nginx.virtualHosts."files.${config.vars.mainDomain}" = lib.mkIf config.services.nextcloud.enable {
|
||||
enableACME = true;
|
||||
addSSL = true;
|
||||
locations."/" = {
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
config = lib.mkIf config.services.nginx.enable {
|
||||
security.acme = {
|
||||
acceptTerms = true;
|
||||
defaults.email = "contact@nixfox.ca";
|
||||
defaults.email = "contact@${config.vars.mainDomain}";
|
||||
};
|
||||
environment.persistence."/persist".directories = [ "/var/lib/acme" ];
|
||||
};
|
||||
|
|
|
@ -2,23 +2,21 @@
|
|||
{
|
||||
imports = [
|
||||
./acme
|
||||
./hosts
|
||||
./rtmp
|
||||
./user
|
||||
];
|
||||
|
||||
options.services.webserver.enable = lib.mkEnableOption "Nginx webpages";
|
||||
|
||||
config = lib.mkIf config.services.nginx.enable {
|
||||
services.nginx = {
|
||||
recommendedTlsSettings = true;
|
||||
recommendedOptimisation = true;
|
||||
recommendedBrotliSettings = true;
|
||||
recommendedGzipSettings = true;
|
||||
recommendedOptimisation = true;
|
||||
recommendedProxySettings = true;
|
||||
recommendedTlsSettings = true;
|
||||
};
|
||||
networking.firewall.allowedTCPPorts = [
|
||||
80
|
||||
443
|
||||
config.services.nginx.defaultHTTPListenPort
|
||||
config.services.nginx.defaultSSLListenPort
|
||||
];
|
||||
environment.persistence."/persist".directories = [ "/var/www" ];
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,9 +0,0 @@
|
|||
{ config, lib, ... }:
|
||||
{
|
||||
imports = [
|
||||
./files
|
||||
./nixfox
|
||||
];
|
||||
|
||||
environment.persistence."/persist".directories = lib.mkIf config.services.webserver.enable [ "/var/www" ];
|
||||
}
|
|
@ -1,8 +0,0 @@
|
|||
{ config, lib, ... }:
|
||||
{
|
||||
services.nginx.virtualHosts."jimbosfiles.com" = lib.mkIf config.services.webserver.enable {
|
||||
enableACME = true;
|
||||
addSSL = true;
|
||||
globalRedirect = "www.nixfox.ca";
|
||||
};
|
||||
}
|
|
@ -1,29 +0,0 @@
|
|||
{ config, lib, ... }:
|
||||
{
|
||||
services.nginx.virtualHosts = lib.mkIf config.services.webserver.enable {
|
||||
"www.nixfox.ca" = {
|
||||
enableACME = true;
|
||||
addSSL = true;
|
||||
default = true;
|
||||
root = "/var/www/landing-page";
|
||||
};
|
||||
"nixfox.ca" = {
|
||||
enableACME = true;
|
||||
addSSL = true;
|
||||
globalRedirect = "www.nixfox.ca";
|
||||
locations = {
|
||||
"/.well-known/matrix/client".extraConfig = ''
|
||||
default_type application/json;
|
||||
return 200 '{
|
||||
"m.homeserver": { "base_url": "https://matrix.nixfox.ca" },
|
||||
"m.identity_server": { "base_url": "https://matrix.org" }
|
||||
}';
|
||||
'';
|
||||
"/.well-known/matrix/server".extraConfig = ''
|
||||
default_type application/json;
|
||||
return 200 '{ "m.server": "matrix.nixfox.ca:443" }';
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
|
@ -1,34 +0,0 @@
|
|||
{ config, lib, pkgs, nodes, ... }:
|
||||
{
|
||||
config = lib.mkIf config.services.webserver.enable {
|
||||
services.nginx = {
|
||||
additionalModules = with pkgs.nginxModules; [ rtmp ];
|
||||
appendConfig = ''
|
||||
rtmp {
|
||||
server {
|
||||
listen 1935;
|
||||
chunk_size 4096;
|
||||
allow publish all;
|
||||
application stream {
|
||||
record off;
|
||||
live on;
|
||||
allow play all;
|
||||
hls on;
|
||||
hls_path /var/www/landing-page/streams/hls/;
|
||||
hls_fragment_naming system;
|
||||
hls_fragment 3;
|
||||
hls_playlist_length 40;
|
||||
}
|
||||
}
|
||||
}
|
||||
'';
|
||||
};
|
||||
networking.firewall.extraInputRules = let
|
||||
targetHosts = lib.attrValues (lib.mapAttrs (_: node: node.config.deployment.targetHost) nodes);
|
||||
in ''
|
||||
ip6 saddr { ${lib.concatStringsSep ", " targetHosts} } tcp dport 1935 accept
|
||||
ip saddr { ${config.secrets.ips.luna}, ${config.secrets.ips.corn} } tcp dport 1935 accept
|
||||
'';
|
||||
systemd.services.nginx.serviceConfig.ReadWritePaths = [ "/var/www/landing-page/streams/hls/" ];
|
||||
};
|
||||
}
|
|
@ -1,6 +1,6 @@
|
|||
{ config, lib, ... }:
|
||||
{
|
||||
services.nginx.virtualHosts."live.nixfox.ca" = lib.mkIf config.services.owncast.enable {
|
||||
services.nginx.virtualHosts."live.${config.vars.mainDomain}" = lib.mkIf config.services.owncast.enable {
|
||||
enableACME = true;
|
||||
forceSSL = true;
|
||||
locations."/" = {
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
|
||||
config = lib.mkIf config.services.transmission.enable {
|
||||
services.transmission = {
|
||||
package = pkgs.transmission_4;
|
||||
credentialsFile = pkgs.writeText "credentials" config.secrets.transmissionCredFile;
|
||||
openPeerPorts = true;
|
||||
settings = {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{ config, lib, ... }:
|
||||
{
|
||||
services.nginx.virtualHosts."tor.nixfox.ca" = lib.mkIf config.services.transmission.enable {
|
||||
services.nginx.virtualHosts."tor.${config.vars.mainDomain}" = lib.mkIf config.services.transmission.enable {
|
||||
enableACME = true;
|
||||
forceSSL = true;
|
||||
locations."/" = {
|
||||
|
|
|
@ -4,16 +4,16 @@
|
|||
|
||||
config = lib.mkIf config.services.vaultwarden.enable {
|
||||
services.vaultwarden.config = {
|
||||
domain = "https://pass.nixfox.ca";
|
||||
domain = "https://pass.${config.vars.mainDomain}";
|
||||
signupsAllowed = false;
|
||||
rocketAddress = "127.0.0.1";
|
||||
rocketPort = 8222;
|
||||
|
||||
# Smtp email
|
||||
smtpHost = "mx.nixfox.ca";
|
||||
smtpFrom = "noreply@nixfox.ca";
|
||||
smtpHost = "mx.${config.vars.mainDomain}";
|
||||
smtpFrom = "noreply@${config.vars.mainDomain}";
|
||||
smtpFromName = "Vaultwarden";
|
||||
smtpUsername = "noreply@nixfox.ca";
|
||||
smtpUsername = "noreply@${config.vars.mainDomain}";
|
||||
smtpPassword = config.secrets.mailPass.nixfoxNoReply;
|
||||
smtpSecurity = "starttls";
|
||||
smtpPort = 587;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{ config, lib, ... }:
|
||||
{
|
||||
services.nginx.virtualHosts."pass.nixfox.ca" = lib.mkIf config.services.vaultwarden.enable {
|
||||
services.nginx.virtualHosts."pass.${config.vars.mainDomain}" = lib.mkIf config.services.vaultwarden.enable {
|
||||
enableACME = true;
|
||||
forceSSL = true;
|
||||
locations."/" = {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{ config, lib, ... }:
|
||||
{
|
||||
services.logind = {
|
||||
powerKey = lib.mkIf config.system.desktop.enable "suspend";
|
||||
powerKey = lib.mkIf (builtins.elem "pc" config.system.nixos.tags) "suspend";
|
||||
powerKeyLongPress = "reboot";
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
{ config, ... }:
|
||||
{
|
||||
security.rtkit.enable = config.system.desktop.enable;
|
||||
security.rtkit.enable = builtins.elem "pc" config.system.nixos.tags;
|
||||
}
|
||||
|
|
|
@ -1,19 +0,0 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
{
|
||||
users.users."freecorn" = lib.mkIf config.system.extraUsers.enable {
|
||||
isNormalUser = true;
|
||||
createHome = true;
|
||||
openssh.authorizedKeys.keys = [
|
||||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBCADciME1/rtWOlR2BxaAkRSgIZt61SYOgjTi6hw+yS Chinook"
|
||||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICtoHVAmq8Ps7EguBsV3VY4snagzkhH6aXqwbKzuGs2H Radiant"
|
||||
];
|
||||
extraGroups = [
|
||||
"audio"
|
||||
"video"
|
||||
];
|
||||
uid = 1001;
|
||||
shell = pkgs.zsh;
|
||||
};
|
||||
|
||||
environment.persistence."/persist".directories = [ "/home/freecorn" ];
|
||||
}
|
|
@ -1,6 +1,8 @@
|
|||
{ lib, ... }:
|
||||
{ ... }:
|
||||
{
|
||||
imports = [ ./main ];
|
||||
|
||||
options.system.extraUsers.enable = lib.mkEnableOption "Enable a shared system";
|
||||
imports = [
|
||||
./freecorn
|
||||
./luna
|
||||
./main
|
||||
];
|
||||
}
|
||||
|
|
19
modules/system/users/freecorn/default.nix
Normal file
19
modules/system/users/freecorn/default.nix
Normal file
|
@ -0,0 +1,19 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
let
|
||||
user = "freecorn";
|
||||
in {
|
||||
config = lib.mkIf (builtins.elem "extra-users" config.system.nixos.tags) {
|
||||
users.users.${user} = {
|
||||
isNormalUser = true;
|
||||
createHome = true;
|
||||
openssh.authorizedKeys.keys = [
|
||||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBCADciME1/rtWOlR2BxaAkRSgIZt61SYOgjTi6hw+yS Chinook"
|
||||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICtoHVAmq8Ps7EguBsV3VY4snagzkhH6aXqwbKzuGs2H Radiant"
|
||||
];
|
||||
shell = pkgs.zsh;
|
||||
uid = 1001;
|
||||
};
|
||||
|
||||
environment.persistence."/persist".directories = [ "/home/${user}" ];
|
||||
};
|
||||
}
|
|
@ -1,17 +1,17 @@
|
|||
{ config, lib, ... }:
|
||||
{
|
||||
users.users."luna" = lib.mkIf config.system.extraUsers.enable {
|
||||
isNormalUser = true;
|
||||
createHome = true;
|
||||
openssh.authorizedKeys.keys = [
|
||||
"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDJ3hzXkv5MVuGZy4HqfEZD0Ck7ZKiLeVmUTFzGSwZkumCpwX/zirD/tY4SNutPczhhYNn1jwkwnnyCwgkaQ7QWBs72G0opmjXDcSqxXJskSKYgjnUHoPV8uAcMwp5C5GNlwo3DFKXc1c7Sipy1s6y9ZnoKfVmjsr0AhamnC/bHEWg8vx0zuamCzvQ5vLWfpULRKwj286f0s2xaAvYaAJwGD0QMHC0ylFYZuq7Og4HVdlnUt+40BxCi+GAQqsFd4vM+RFjZKKD7ioP5DcIDfvfvxX4UpdKtCxVjeyyF+UJpFnQKytO9HvH4H+CRSAuJ+Vguiq/F3lGhvF0yIQ9M2MD3+tl3RZAj4D6n2ew30mn+QGh2fZgC7Utuzo02pMVUzkpm+mM4x8VyESpC1AuBdh0TAKBwS3ubMpegiCWCfIbNC0CQ/zgIq/5xwhXL8zhmfQrIiULBCd1xqThye0tt7knoPZlVCzOuVYoqxYnwYYGcXhzlArrmgRquyMYHdpFd+DTzJfcQIGdT4a+s0Mc2jRa0KT3A4ZrjziP0OPMQ+cpTd1tmQdEKXN6YhB87Hp9meCefFdzGvVembose82d3BOl45+rWM2ZcH93fNguWwYX0ez8+GiGW4P+gDQcfWfQCNa1daDjgoBwjmbG5rYoS6tfLxSSvYB1YOOK9U3AlPxEuTw== luna@ThinkPad-T480-Arch"
|
||||
];
|
||||
extraGroups = [
|
||||
"audio"
|
||||
"video"
|
||||
];
|
||||
uid = 1002;
|
||||
};
|
||||
let
|
||||
user = "luna";
|
||||
in {
|
||||
config = lib.mkIf (builtins.elem "extra-users" config.system.nixos.tags) {
|
||||
users.users.${user} = {
|
||||
isNormalUser = true;
|
||||
createHome = true;
|
||||
openssh.authorizedKeys.keys = [
|
||||
"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDJ3hzXkv5MVuGZy4HqfEZD0Ck7ZKiLeVmUTFzGSwZkumCpwX/zirD/tY4SNutPczhhYNn1jwkwnnyCwgkaQ7QWBs72G0opmjXDcSqxXJskSKYgjnUHoPV8uAcMwp5C5GNlwo3DFKXc1c7Sipy1s6y9ZnoKfVmjsr0AhamnC/bHEWg8vx0zuamCzvQ5vLWfpULRKwj286f0s2xaAvYaAJwGD0QMHC0ylFYZuq7Og4HVdlnUt+40BxCi+GAQqsFd4vM+RFjZKKD7ioP5DcIDfvfvxX4UpdKtCxVjeyyF+UJpFnQKytO9HvH4H+CRSAuJ+Vguiq/F3lGhvF0yIQ9M2MD3+tl3RZAj4D6n2ew30mn+QGh2fZgC7Utuzo02pMVUzkpm+mM4x8VyESpC1AuBdh0TAKBwS3ubMpegiCWCfIbNC0CQ/zgIq/5xwhXL8zhmfQrIiULBCd1xqThye0tt7knoPZlVCzOuVYoqxYnwYYGcXhzlArrmgRquyMYHdpFd+DTzJfcQIGdT4a+s0Mc2jRa0KT3A4ZrjziP0OPMQ+cpTd1tmQdEKXN6YhB87Hp9meCefFdzGvVembose82d3BOl45+rWM2ZcH93fNguWwYX0ez8+GiGW4P+gDQcfWfQCNa1daDjgoBwjmbG5rYoS6tfLxSSvYB1YOOK9U3AlPxEuTw== ${user}@ThinkPad-T480-Arch"
|
||||
];
|
||||
uid = 1002;
|
||||
};
|
||||
|
||||
environment.persistence."/persist".directories = [ "/home/luna" ];
|
||||
environment.persistence."/persist".directories = [ "/home/${user}" ];
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,56 +1,48 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
{
|
||||
options.sysusers = lib.mkOption {
|
||||
type = lib.types.attrs;
|
||||
users.users."${config.vars.mainUser}" = {
|
||||
isNormalUser = true;
|
||||
createHome = true;
|
||||
linger = true;
|
||||
hashedPassword = config.secrets.accPass.main;
|
||||
openssh.authorizedKeys.keyFiles = [
|
||||
../../../../hosts/tower/id_ed25519.pub
|
||||
../../../../hosts/detritus/id_ed25519.pub
|
||||
|
||||
../../../../hosts/intuos/id_ed25519.pub
|
||||
../../../../hosts/jupiter/id_ed25519.pub
|
||||
|
||||
../../../../hosts/midas/id_ed25519.pub
|
||||
../../../../hosts/kitty/id_ed25519.pub
|
||||
../../../../hosts/prophet/id_ed25519.pub
|
||||
];
|
||||
openssh.authorizedKeys.keys = [
|
||||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIN3B9Uf3h5JiD2HjF/vQ5Zx9pibMgRrlf7ZoBktev9eB Warden"
|
||||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJahAoF74BY6GCTsFkt1ADKaraFgJJozW1Y1aBTLK0j9 Pixel9"
|
||||
];
|
||||
extraGroups = [
|
||||
"wheel"
|
||||
|
||||
"audio"
|
||||
"input"
|
||||
"render"
|
||||
"video"
|
||||
|
||||
"dialout"
|
||||
"disk"
|
||||
"rtkit"
|
||||
|
||||
"kvm"
|
||||
"libvirtd"
|
||||
"qemu-libvirtd"
|
||||
|
||||
"minecraft"
|
||||
"nfsShare"
|
||||
"nginx"
|
||||
];
|
||||
shell = pkgs.zsh;
|
||||
uid = 1000;
|
||||
};
|
||||
|
||||
config = {
|
||||
sysusers.main = "bun";
|
||||
|
||||
users.users."${config.sysusers.main}" = {
|
||||
isNormalUser = true;
|
||||
createHome = true;
|
||||
linger = true;
|
||||
hashedPassword = config.secrets.accPass.main;
|
||||
openssh.authorizedKeys.keyFiles = [
|
||||
../../../../hosts/tower/id_ed25519.pub
|
||||
../../../../hosts/detritus/id_ed25519.pub
|
||||
|
||||
../../../../hosts/intuos/id_ed25519.pub
|
||||
../../../../hosts/jupiter/id_ed25519.pub
|
||||
|
||||
../../../../hosts/midas/id_ed25519.pub
|
||||
../../../../hosts/kitty/id_ed25519.pub
|
||||
../../../../hosts/prophet/id_ed25519.pub
|
||||
];
|
||||
openssh.authorizedKeys.keys = [
|
||||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIN3B9Uf3h5JiD2HjF/vQ5Zx9pibMgRrlf7ZoBktev9eB Warden"
|
||||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJahAoF74BY6GCTsFkt1ADKaraFgJJozW1Y1aBTLK0j9 Pixel9"
|
||||
];
|
||||
extraGroups = [
|
||||
"wheel"
|
||||
|
||||
"audio"
|
||||
"input"
|
||||
"render"
|
||||
"video"
|
||||
|
||||
"dialout"
|
||||
"disk"
|
||||
"rtkit"
|
||||
|
||||
"kvm"
|
||||
"libvirtd"
|
||||
"qemu-libvirtd"
|
||||
|
||||
"minecraft"
|
||||
"nfsShare"
|
||||
"nginx"
|
||||
];
|
||||
uid = 1000;
|
||||
shell = pkgs.zsh;
|
||||
};
|
||||
|
||||
home-manager.users."${config.sysusers.main}" = import ../../../home;
|
||||
};
|
||||
home-manager.users."${config.vars.mainUser}" = import ../../../home;
|
||||
}
|
||||
|
|
11
modules/system/variables/default.nix
Normal file
11
modules/system/variables/default.nix
Normal file
|
@ -0,0 +1,11 @@
|
|||
{ lib, ... }:
|
||||
{
|
||||
options.vars = lib.mkOption {
|
||||
type = lib.types.attrs;
|
||||
};
|
||||
|
||||
config.vars = {
|
||||
mainUser = "bun";
|
||||
mainDomain = "nixfox.ca";
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue