1
Fork 0
mirror of https://github.com/RGBCube/ncc synced 2025-07-29 19:17:45 +00:00

Multi hosts, finally

This commit is contained in:
RGBCube 2024-01-02 13:41:00 +03:00
parent 084d2093bd
commit bd42073480
No known key found for this signature in database
48 changed files with 200 additions and 311 deletions

2
.gitignore vendored
View file

@ -10,7 +10,6 @@
!modules/autofreq/ !modules/autofreq/
!modules/bat/ !modules/bat/
!modules/blueman/ !modules/blueman/
!modules/boot/
!modules/btop/ !modules/btop/
!modules/discord/ !modules/discord/
!modules/dunst/ !modules/dunst/
@ -27,6 +26,7 @@
!modules/kitty/ !modules/kitty/
!modules/localisation/ !modules/localisation/
!modules/logind/ !modules/logind/
!modules/nano/
!modules/networkmanager/ !modules/networkmanager/
!modules/nix/ !modules/nix/
!modules/nushell/ !modules/nushell/

View file

@ -8,8 +8,8 @@
, hicolor-icon-theme , hicolor-icon-theme
}: }:
stdenvNoCC.mkDerivation rec { stdenvNoCC.mkDerivation {
pname = "gruvbox-plus-icons"; pname = "gruvbox-plus-icon-pack";
version = "unstable-2023-12-07"; version = "unstable-2023-12-07";
src = fetchFromGitHub { src = fetchFromGitHub {
@ -42,6 +42,6 @@ stdenvNoCC.mkDerivation rec {
homepage = "https://github.com/SylEleuth/gruvbox-plus-icon-pack"; homepage = "https://github.com/SylEleuth/gruvbox-plus-icon-pack";
license = licenses.gpl3Only; license = licenses.gpl3Only;
platforms = platforms.linux; platforms = platforms.linux;
maintainers = with maintainers; [ eureka-cpu ]; maintainers = with maintainers; [ eureka-cpu RGBCube ];
}; };
} }

View file

@ -86,7 +86,6 @@
nixSuper, nixSuper,
nixpkgs, nixpkgs,
homeManager, homeManager,
ghosttyModule,
nuScripts, nuScripts,
fenix, fenix,
zig, zig,
@ -95,28 +94,38 @@
themes, themes,
... ...
} @ inputs: let } @ inputs: let
lib = nixpkgs.lib; importConfiguration = host: let
hostDefault = import ./hosts/${host} {
# Will explode if you try to use user dependant stuff.
ulib = (import ./lib lib null) // { merge = lib.recursiveUpdate; };
};
configuration = host: { users = {
system, all = builtins.attrNames hostDefault.users.users ++ [ "root" ];
normalUsers, graphical = builtins.attrNames (lib.filterAttrs (name: value: builtins.elem "graphical" (value.extraGroups or [])) hostDefault.users.users);
graphicalUsers ? [], };
}: let
ulib = import ./lib lib normalUsers graphicalUsers;
pkgs = import nixpkgs { inherit system; }; system = hostDefault.nixpkgs.hostPlatform;
upkgs = { lib = nixpkgs.lib;
inherit nuScripts; ulib = import ./lib lib users;
zig = zig.packages.${system}.master; pkgs = import nixpkgs { inherit system; };
} // (lib.genAttrs upkgs = let
[ "nixSuper" "hyprland" "hyprpicker" "ghostty" "zls" ] defaults = lib.genAttrs
(name: inputs.${name}.packages.${system}.default)); [ "nixSuper" "hyprland" "hyprpicker" "ghostty" "zls" ]
(name: inputs.${name}.packages.${system}.default);
other = {
inherit nuScripts;
zig = zig.packages.${system}.master;
};
in defaults // other;
theme = themes.custom (themes.raw.gruvbox-dark-hard // { theme = themes.custom (themes.raw.gruvbox-dark-hard // {
corner-radius = 8; cornerRadius = 8;
border-width = 2; borderWidth = 2;
margin = 6; margin = 6;
padding = 8; padding = 8;
@ -131,19 +140,16 @@
font.mono.package = (pkgs.nerdfonts.override { fonts = [ "JetBrainsMono" ]; }); font.mono.package = (pkgs.nerdfonts.override { fonts = [ "JetBrainsMono" ]; });
icons.name = "Gruvbox-Plus-Dark"; icons.name = "Gruvbox-Plus-Dark";
icons.package = pkgs.callPackage (import ./derivations/gruvbox-icons.nix) {}; icons.package = pkgs.callPackage (import ./derivations/gruvbox-plus-icon-pack.nix) {};
}); });
defaultConfiguration = { defaultConfiguration = {
environment.defaultPackages = [];
home-manager.sharedModules = [ ghosttyModule.homeModules.default ];
home-manager.useGlobalPkgs = true; home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true; home-manager.useUserPackages = true;
networking.hostName = host; networking.hostName = host;
nixpkgs.hostPlatform = system;
}; };
in lib.nixosSystem { in lib.nixosSystem {
inherit system; inherit system;
@ -151,26 +157,17 @@
modules = [ modules = [
homeManager.nixosModules.default homeManager.nixosModules.default
site.nixosModules.default site.nixosModules.default
defaultConfiguration defaultConfiguration
./hosts/${host} ] ++ (builtins.attrValues (builtins.mapAttrs (name: type: ./modules/${name}) (builtins.readDir ./modules)))
]; ++ (builtins.attrValues (builtins.mapAttrs (name: type: ./hosts/${host}/${name}) (builtins.readDir ./hosts/${host})));
}; };
configurations = builtins.mapAttrs configuration; hosts = (builtins.attrNames
(nixpkgs.lib.filterAttrs
(name: value: value == "directory")
(builtins.readDir ./hosts)));
in { in {
nixosConfigurations = configurations { nixosConfigurations = nixpkgs.lib.genAttrs hosts importConfiguration;
enka = {
system = "x86_64-linux";
normalUsers = [ "nixos" "root" ];
graphicalUsers = [ "nixos" ];
};
cube = {
system = "x86_64-linux";
normalUsers = [ "rgb" "root" ];
};
};
}; };
} }

View file

@ -1,12 +1,14 @@
{ lib, ulib, ... }: with ulib; merge3 { ulib, ... }: with ulib; merge
(systemConfiguration { (systemConfiguration {
system.stateVersion = "23.05"; system.stateVersion = "23.05";
nixpkgs.hostPlatform = "x86_64-linux";
time.timeZone = "Europe/Amsterdam"; time.timeZone = "Europe/Amsterdam";
users.users.rgb = normalUser { users.users.rgb = normalUser {
description = "NixOS"; description = "RGB";
extraGroups = [ "wheel" ]; extraGroups = [ "wheel" ];
openssh.authorizedKeys.keys = [ "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDRSLWxpIMOZIQv9ggDnAwSxmux/TZvuEPgq2HFiH+oI2OE07xYQAiroBVI5HH+aIg1nwpYtArANoD8V9Hrx2XCo2py/fMi9LhJWNMlFVcRLqYrCmrZYhBqZhxXIdY+wXqkSE7kvTKsz84BrhwilfA/bqTgVw2Ro6w0RnTzUhlYx4w10DT3isN09cQJMgvuyWNRlpGpkEGhPwyXythKM2ERoHTfq/XtpiGZQeLr6yoTTd9q4rbvnGGka5IUEz3RrmeXEs13l02IY6dCUFJkRRsK8dvB9zFjQyM08IqdaoHeudZoCOsnl/AiegZ7C5FoYEKIXY86RqxS3TH3nwuxe2fXTNr9gwf2PumM1Yh2WxV4+pHQOksxW8rWgv1nXMT5AG0RrJxr+S0Nn7NBbzCImrprX3mg4vJqT24xcUjUSDYllEMa2ioXGCeff8cwVKK/Ly5fwj0AX1scjiw+b7jD6VvDLA5z+ALwCblxiRMCN0SOMk9/V2Xsg9YIRMHyQwpqu8k= u0_a216@localhost" ]; openssh.authorizedKeys.keys = [ "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDRSLWxpIMOZIQv9ggDnAwSxmux/TZvuEPgq2HFiH+oI2OE07xYQAiroBVI5HH+aIg1nwpYtArANoD8V9Hrx2XCo2py/fMi9LhJWNMlFVcRLqYrCmrZYhBqZhxXIdY+wXqkSE7kvTKsz84BrhwilfA/bqTgVw2Ro6w0RnTzUhlYx4w10DT3isN09cQJMgvuyWNRlpGpkEGhPwyXythKM2ERoHTfq/XtpiGZQeLr6yoTTd9q4rbvnGGka5IUEz3RrmeXEs13l02IY6dCUFJkRRsK8dvB9zFjQyM08IqdaoHeudZoCOsnl/AiegZ7C5FoYEKIXY86RqxS3TH3nwuxe2fXTNr9gwf2PumM1Yh2WxV4+pHQOksxW8rWgv1nXMT5AG0RrJxr+S0Nn7NBbzCImrprX3mg4vJqT24xcUjUSDYllEMa2ioXGCeff8cwVKK/Ly5fwj0AX1scjiw+b7jD6VvDLA5z+ALwCblxiRMCN0SOMk9/V2Xsg9YIRMHyQwpqu8k= u0_a216@localhost" ];
}; };
@ -14,31 +16,4 @@
(homeConfiguration { (homeConfiguration {
home.stateVersion = "23.11"; home.stateVersion = "23.11";
programs.git.extraConfig.commit.gpgSign = lib.mkForce false;
}) })
(importModules [
./hardware.nix
"bat"
"btop"
"endlessh"
"git"
"helix"
"kernel"
"localisation"
"networkmanager"
"nix"
"nushell"
"openssh"
"pueue"
"packages"
"python"
"ripgrep"
"rust"
"site"
"ssh"
"sudo"
"tmp"
])

View file

@ -1,9 +1,7 @@
{ ulib, modulesPath, ... }: with ulib; { ulib, modulesPath, ... }: with ulib;
systemConfiguration { systemConfiguration {
imports = [ imports = [ (modulesPath + "/profiles/qemu-guest.nix") ];
(modulesPath + "/profiles/qemu-guest.nix")
];
boot.loader.grub = enabled { boot.loader.grub = enabled {
device = "/dev/vda"; device = "/dev/vda";

View file

@ -1,17 +0,0 @@
{ ulib, pkgs, ... }: with ulib;
systemPackages (with pkgs; [
fastfetch
fd
hyperfine
moreutils
nix-index
nix-output-monitor
p7zip
pstree
strace
tree
yt-dlp
gh
])

View file

@ -1,12 +1,13 @@
{ ulib, ... }: with ulib; merge3 { ulib, ... }: with ulib; merge
(systemConfiguration { (systemConfiguration {
system.stateVersion = "23.05"; system.stateVersion = "23.05";
console.keyMap = "trq"; nixpkgs.hostPlatform = "x86_64-linux";
time.timeZone = "Europe/Istanbul"; time.timeZone = "Europe/Istanbul";
users.users.nixos = normalUser { users.users.nixos = graphicalUser {
description = "NixOS"; description = "NixOS";
extraGroups = [ "wheel" ]; extraGroups = [ "wheel" ];
}; };
@ -19,44 +20,3 @@
(homeConfiguration { (homeConfiguration {
home.stateVersion = "23.05"; home.stateVersion = "23.05";
}) })
(importModules [
./hardware.nix
"autofreq"
"bat"
"blueman"
"boot"
"btop"
"discord"
"dunst"
"firefox"
"fonts"
"fuzzel"
"ghostty"
"git"
"gtk"
"helix"
"hyprland"
"kernel"
"kitty"
"localisation"
"logind"
"networkmanager"
"nix"
"nushell"
"openttd"
"packages"
"pipewire"
"pueue"
"python"
"qt"
"ripgrep"
"rust"
"ssh"
"steam"
"sudo"
"tmp"
"w3m"
"waybar"
])

View file

@ -1,4 +1,12 @@
{ { ulib, ... }: with ulib;
systemConfiguration {
boot.loader = {
efi.canTouchEfiVariables = true;
systemd-boot.enable = true;
systemd-boot.editor = false;
};
boot.initrd.availableKernelModules = [ boot.initrd.availableKernelModules = [
"ahci" "ahci"
"rtsx_pci_sdmmc" "rtsx_pci_sdmmc"

View file

@ -1,44 +0,0 @@
{ ulib, pkgs, upkgs, ... }: with ulib; merge
(systemPackages (with pkgs; [
asciinema
fastfetch
fd
hyperfine
moreutils
nix-index
nix-output-monitor
p7zip
pstree
strace
timg
tree
usbutils
yt-dlp
wine
clang_16
clang-tools_16
gh
go
jdk
lld
maven
upkgs.zig
vlang
]))
(graphicalPackages (with pkgs; [
qbittorrent
thunderbird
whatsapp-for-linux
xfce.thunar
krita
obs-studio
libreoffice
hunspellDicts.en_US
hunspellDicts.en_GB-ize
]))

View file

@ -1,31 +1,37 @@
normalUsers: graphicalUsers: lib: users: let
rec {
inherit normalUsers graphicalUsers;
systemConfiguration = configuration: configuration;
systemPackages = packages: systemConfiguration {
environment.systemPackages = packages;
};
systemFonts = packages: systemConfiguration {
fonts.packages = packages;
};
userHomeConfiguration = users: configuration: { userHomeConfiguration = users: configuration: {
home-manager.users = builtins.foldl' (final: user: final // { home-manager.users = builtins.foldl' (final: user: final // {
${user} = configuration; ${user} = configuration;
}) {} (if builtins.isList users then users else [ users ]); }) {} (if builtins.isList users then users else [ users ]);
}; };
in rec {
inherit users;
graphicalConfiguration = userHomeConfiguration graphicalUsers; isServer = users.graphical == [];
graphicalPackages = packages: graphicalConfiguration { isDesktop = !isServer;
home.packages = packages;
};
homeConfiguration = userHomeConfiguration normalUsers; # For every machine.
homePackages = packages: homeConfiguration { systemConfiguration = configuration: configuration;
home.packages = packages; systemPackages = packages: systemConfiguration { environment.systemPackages = packages; };
}; systemFonts = packages: systemConfiguration { fonts.packages = packages; };
# For every user, on every machine.
homeConfiguration = configuration: { home-manager.sharedModules = [ configuration ]; };
homePackages = packages: homeConfiguration { home.packages = packages; };
# For every desktop.
desktopSystemConfiguration = configuration: if isServer then {} else configuration;
desktopSystemPackages = packages: if isServer then {} else systemPackages packages;
desktopSystemFonts = packages: if isServer then {} else systemFonts packages;
# For every graphical user on every desktop.
desktopHomeConfiguration = configuration: if isServer then {} else userHomeConfiguration users.graphical configuration;
desktopHomePackages = packages: if isServer then {} else desktopHomeConfiguration { home.packages = packages; };
# For every server.
serverSystemConfiguration = configuration: if isServer then configuration else {};
serverSystemPackages = packages: if isServer then systemPackages packages else {};
serverSystemFonts = packages: if isServer then systemFonts packages else {};
# For every user on every server.
serverHomeConfiguration = configuration: if isServer then homeConfiguration configuration else {};
serverHomePackages = packages: if isServer then homePackages packages else {};
} }

View file

@ -1,9 +1,5 @@
lib: normalUsers: graphicalUsers: lib: users: let
configuration = import ./configuration.nix lib users;
(import ./configuration.nix normalUsers graphicalUsers) merge = import ./merge.nix lib;
// values = import ./values.nix;
(import ./merge.nix lib) in configuration // merge // values
//
(import ./modules.nix)
//
(import ./values.nix)

View file

@ -1,8 +1,11 @@
lib: lib: let
mergeAll = builtins.foldl' (collected: module: {
rec { imports = collected.imports ++ [ module ];
merge = lib.recursiveUpdate; }) { imports = []; };
merge3 = x: y: merge (merge x y); in {
merge4 = x: y: merge3 (merge x y); merge = a: b: mergeAll [ a b ];
merge5 = x: y: merge4 (merge x y); merge3 = a: b: c: mergeAll [ a b c ];
merge4 = a: b: c: d: mergeAll [ a b c d ];
merge5 = a: b: c: d: e: mergeAll [ a b c d e ];
merge6 = a: b: c: d: e: f: mergeAll [ a b c d e f ];
} }

View file

@ -1,8 +0,0 @@
{
importModules = modules: {
imports = builtins.map (module: if builtins.isPath module then
module
else
../modules/${module}) modules;
};
}

View file

@ -6,4 +6,9 @@
normalUser = attributes: attributes // { normalUser = attributes: attributes // {
isNormalUser = true; isNormalUser = true;
}; };
graphicalUser = attributes: attributes // {
isNormalUser = true;
extraGroups = [ "graphical" ] ++ attributes.extraGroups or [];
};
} }

View file

@ -1,5 +1,5 @@
{ ulib, ... }: with ulib; { ulib, ... }: with ulib;
systemConfiguration { desktopSystemConfiguration {
services.auto-cpufreq = enabled {}; services.auto-cpufreq = enabled {};
} }

View file

@ -1,6 +1,6 @@
{ ulib, ... }: with ulib; { ulib, ... }: with ulib;
systemConfiguration { desktopSystemConfiguration {
services.blueman = enabled {}; services.blueman = enabled {};
hardware.bluetooth = enabled { hardware.bluetooth = enabled {

View file

@ -1,9 +0,0 @@
{ ulib, pkgs, ... }: with ulib;
systemConfiguration {
boot.loader = {
efi.canTouchEfiVariables = true;
systemd-boot.enable = true;
systemd-boot.editor = false;
};
}

View file

@ -6,6 +6,6 @@ homeConfiguration {
programs.btop = enabled { programs.btop = enabled {
settings.color_theme = "base16"; settings.color_theme = "base16";
settings.rounded_corners = theme.corner-radius != 0; settings.rounded_corners = theme.cornerRadius != 0;
}; };
} }

View file

@ -1,10 +1,14 @@
{ ulib, pkgs, theme, ... }: with ulib; merge { ulib, pkgs, theme, ... }: with ulib; merge3
(graphicalConfiguration { (desktopSystemConfiguration {
nixpkgs.config.allowUnfree = true;
})
(desktopHomeConfiguration {
xdg.configFile."Vencord/settings/quickCss.css".text = theme.discordCss; xdg.configFile."Vencord/settings/quickCss.css".text = theme.discordCss;
}) })
(graphicalPackages (with pkgs; [ (desktopSystemPackages (with pkgs; [
(discord.override { (discord.override {
withOpenASAR = true; withOpenASAR = true;
withVencord = true; withVencord = true;

View file

@ -1,6 +1,6 @@
{ ulib, theme, ... }: with ulib; { ulib, theme, ... }: with ulib;
graphicalConfiguration { desktopHomeConfiguration {
services.dunst = with theme.withHashtag; enabled { services.dunst = with theme.withHashtag; enabled {
iconTheme = icons; iconTheme = icons;
@ -9,13 +9,13 @@ graphicalConfiguration {
dmenu = "fuzzel --dmenu"; dmenu = "fuzzel --dmenu";
corner_radius = corner-radius; corner_radius = cornerRadius;
gap_size = margin; gap_size = margin;
horizontal_padding = padding; horizontal_padding = padding;
padding = padding; padding = padding;
frame_color = base0A; frame_color = base0A;
frame_width = border-width; frame_width = borderWidth;
separator_color = "frame"; separator_color = "frame";
background = base00; background = base00;

View file

@ -1,6 +1,6 @@
{ ulib, ... }: with ulib; { ulib, ... }: with ulib;
systemConfiguration { serverSystemConfiguration {
services.endlessh = enabled { services.endlessh = enabled {
openFirewall = true; openFirewall = true;
port = 22; port = 22;

View file

@ -1,6 +1,6 @@
{ ulib, ... }: with ulib; { ulib, ... }: with ulib;
graphicalConfiguration { desktopHomeConfiguration {
programs.firefox = enabled {}; programs.firefox = enabled {};
programs.librewolf = enabled {}; programs.librewolf = enabled {};

View file

@ -8,7 +8,7 @@
}; };
}) })
(systemFonts (with pkgs; [ (desktopSystemFonts (with pkgs; [
theme.font.sans.package theme.font.sans.package
theme.font.mono.package theme.font.mono.package

View file

@ -1,6 +1,6 @@
{ ulib, theme, ... }: with ulib; { ulib, theme, ... }: with ulib;
graphicalConfiguration { desktopHomeConfiguration {
programs.fuzzel = with theme; enabled { programs.fuzzel = with theme; enabled {
settings.main = { settings.main = {
dpi-aware = false; dpi-aware = false;
@ -29,8 +29,8 @@ graphicalConfiguration {
}; };
settings.border = { settings.border = {
radius = corner-radius; radius = cornerRadius;
width = border-width; width = borderWidth;
}; };
}; };
} }

View file

@ -1,6 +1,10 @@
{ lib, ulib, pkgs, upkgs, theme, ... }: with ulib; { inputs, lib, ulib, pkgs, upkgs, theme, ... }: with ulib; merge
graphicalConfiguration { (desktopSystemConfiguration {
home-manager.sharedModules = [ inputs.ghosttyModule.homeModules.default ];
})
(desktopHomeConfiguration {
programs.nushell.environmentVariables.TERMINAL = "ghostty"; programs.nushell.environmentVariables.TERMINAL = "ghostty";
programs.ghostty = enabled { programs.ghostty = enabled {
@ -69,4 +73,4 @@ graphicalConfiguration {
]; ];
}; };
}; };
} })

View file

@ -1,4 +1,4 @@
{ ulib, pkgs, ... }: with ulib; { lib, ulib, pkgs, ... }: with ulib;
homeConfiguration { homeConfiguration {
programs.nushell.shellAliases = { programs.nushell.shellAliases = {
@ -59,11 +59,11 @@ homeConfiguration {
init.defaultBranch = "master"; init.defaultBranch = "master";
push.autoSetupRemote = true; push.autoSetupRemote = true;
url."ssh://git@github.com/".insteadOf = "https://github.com/";
} // lib.mkIf ulib.isDesktop {
commit.gpgSign = true; commit.gpgSign = true;
gpg.format = "ssh"; gpg.format = "ssh";
user.signingKey = "~/.ssh/id_rsa"; user.signingKey = "~/.ssh/id_rsa";
url."ssh://git@github.com/".insteadOf = "https://github.com/";
}; };
}; };
} }

View file

@ -1,10 +1,10 @@
{ ulib, pkgs, theme, ... }: with ulib; merge { ulib, pkgs, theme, ... }: with ulib; merge
(systemConfiguration { (desktopSystemConfiguration {
programs.dconf = enabled {}; programs.dconf = enabled {};
}) })
(graphicalConfiguration { (desktopHomeConfiguration {
gtk = enabled { gtk = enabled {
gtk3.extraCss = theme.adwaitaGtkCss; gtk3.extraCss = theme.adwaitaGtkCss;
gtk4.extraCss = theme.adwaitaGtkCss; gtk4.extraCss = theme.adwaitaGtkCss;

View file

@ -67,7 +67,7 @@
}; };
}) })
(homePackages (with pkgs; [ (desktopSystemPackages (with pkgs; [
# CMAKE # CMAKE
cmake-language-server cmake-language-server

View file

@ -1,6 +1,6 @@
{ ulib, pkgs, upkgs, theme, ... }: with ulib; merge3 { ulib, pkgs, upkgs, theme, ... }: with ulib; merge3
(systemConfiguration { (desktopSystemConfiguration {
hardware.opengl = enabled {}; hardware.opengl = enabled {};
xdg.portal = enabled { xdg.portal = enabled {
@ -12,7 +12,7 @@
}; };
}) })
(graphicalConfiguration { (desktopHomeConfiguration {
wayland.windowManager.hyprland = with theme; enabled { wayland.windowManager.hyprland = with theme; enabled {
package = upkgs.hyprland; package = upkgs.hyprland;
@ -140,7 +140,7 @@
'' ''
decoration { decoration {
drop_shadow = false drop_shadow = false
rounding = ${toString corner-radius} rounding = ${toString cornerRadius}
blur { blur {
enabled = false enabled = false
@ -154,7 +154,7 @@
gaps_in = ${toString (margin/ 2)} gaps_in = ${toString (margin/ 2)}
gaps_out = ${toString margin} gaps_out = ${toString margin}
border_size = ${toString border-width} border_size = ${toString borderWidth}
col.active_border = 0xFF${base0A} col.active_border = 0xFF${base0A}
col.nogroup_border_active = 0xFF${base0A} col.nogroup_border_active = 0xFF${base0A}
@ -215,7 +215,7 @@
}; };
}) })
(homePackages (with pkgs; [ (desktopHomePackages (with pkgs; [
brightnessctl brightnessctl
cliphist cliphist
grim grim

View file

@ -1,6 +1,6 @@
{ ulib, theme, ... }: with ulib; { ulib, theme, ... }: with ulib;
graphicalConfiguration { desktopHomeConfiguration {
programs.kitty = with theme.withHashtag; enabled { programs.kitty = with theme.withHashtag; enabled {
font = with font; { font = with font; {
inherit (mono) name package; inherit (mono) name package;

View file

@ -1,6 +1,8 @@
{ ulib, ... }: with ulib; { ulib, ... }: with ulib;
systemConfiguration { systemConfiguration {
console.keyMap = "trq";
i18n.defaultLocale = "en_US.UTF-8"; i18n.defaultLocale = "en_US.UTF-8";
i18n.extraLocaleSettings = let i18n.extraLocaleSettings = let
locale = "tr_TR.UTF-8"; locale = "tr_TR.UTF-8";

View file

@ -1,5 +1,5 @@
{ ulib, ... }: with ulib; { ulib, ... }: with ulib;
systemConfiguration { desktopSystemConfiguration {
services.logind.powerKey = "ignore"; services.logind.powerKey = "ignore";
} }

5
modules/nano/default.nix Normal file
View file

@ -0,0 +1,5 @@
{ ulib, ... }: with ulib;
systemConfiguration {
environment.defaultPackages = [];
}

View file

@ -1,11 +1,11 @@
{ ulib, ... }: with ulib; merge { ulib, ... }: with ulib; merge
(systemConfiguration { (desktopSystemConfiguration {
networking.networkmanager = enabled {}; networking.networkmanager = enabled {};
users.extraGroups.networkmanager.members = ulib.normalUsers; users.extraGroups.networkmanager.members = ulib.users.all;
}) })
(homeConfiguration { (desktopHomeConfiguration {
programs.nushell.shellAliases.wifi = "nmcli dev wifi show-password"; programs.nushell.shellAliases.wifi = "nmcli dev wifi show-password";
}) })

View file

@ -1,4 +1,4 @@
'' { lib, ulib, ... }: ''
$env.config = { $env.config = {
bracketed_paste: true bracketed_paste: true
buffer_editor: "" buffer_editor: ""
@ -182,15 +182,17 @@ $env.config.cursor_shape = {
$env.config.hooks = { $env.config.hooks = {
command_not_found: {|| command_not_found: {||
task status ${lib.optionals ulib.isDesktop ''
| where label == boom task status
| get id | where label == boom
| each {|id| | get id
task kill $id | null | each {|id|
task remove $id | null task kill $id | null
} task remove $id | null
}
task spawn --label boom { pw-play ${./boom.opus} } task spawn --label boom { pw-play ${./boom.opus} }
''}
} }
display_output: "table --expand" display_output: "table --expand"
env_change: {} env_change: {}

View file

@ -1,4 +1,4 @@
{ config, ulib, pkgs, upkgs, theme, ... }: with ulib; merge3 { config, ulib, pkgs, ... } @ inputs: with ulib; merge3
(systemConfiguration { (systemConfiguration {
users.defaultUserShell = pkgs.nushell; users.defaultUserShell = pkgs.nushell;
@ -8,11 +8,8 @@
programs.starship = enabled {}; programs.starship = enabled {};
programs.nushell = enabled { programs.nushell = enabled {
configFile.text = import ./configuration.nix.nu; configFile.text = import ./configuration.nix.nu inputs;
envFile.text = import ./environment.nix.nu { envFile.text = import ./environment.nix.nu inputs;
inherit (upkgs) nuScripts;
inherit theme;
};
environmentVariables = { environmentVariables = {
inherit (config.environment.variables) NIX_LD; inherit (config.environment.variables) NIX_LD;

View file

@ -1,7 +1,9 @@
{ nuScripts, theme }: '' { lib, ulib, upkgs, theme, ... }: ''
if (tty) == /dev/tty1 { ${lib.optionals ulib.isDesktop ''
(Hyprland) if (tty) == /dev/tty1 {
} (Hyprland)
}
''}
$env.PROMPT_INDICATOR = ""; $env.PROMPT_INDICATOR = "";
$env.PROMPT_INDICATOR_VI_INSERT = ""; $env.PROMPT_INDICATOR_VI_INSERT = "";
@ -34,5 +36,5 @@ def --wrapped hx [...arguments] {
} }
} }
use ${nuScripts}/modules/background_task/task.nu use ${upkgs.nuScripts}/modules/background_task/task.nu
'' ''

View file

@ -1,8 +1,8 @@
{ config, ulib, ... }: with ulib; { ulib, ... }: with ulib;
systemConfiguration { serverSystemConfiguration {
services.openssh = enabled { services.openssh = enabled {
ports = if config.services.endlessh.enable then [ 2222 ] else [ 22 ]; ports = [ 2222 ];
settings = { settings = {
KbdInteractiveAuthentication = false; KbdInteractiveAuthentication = false;
PasswordAuthentication = false; PasswordAuthentication = false;

View file

@ -1,5 +1,5 @@
{ ulib, pkgs, ... }: with ulib; { ulib, pkgs, ... }: with ulib;
graphicalPackages (with pkgs; [ desktopHomePackages (with pkgs; [
openttd openttd
]) ])

View file

@ -1,4 +1,4 @@
{ ulib, pkgs, upkgs, ... }: with ulib; merge { ulib, pkgs, upkgs, ... }: with ulib; merge3
(systemPackages (with pkgs; [ (systemPackages (with pkgs; [
asciinema asciinema
@ -15,9 +15,9 @@
tree tree
usbutils usbutils
yt-dlp yt-dlp
]))
wine (desktopSystemPackages (with pkgs; [
clang_16 clang_16
clang-tools_16 clang-tools_16
gh gh
@ -27,9 +27,11 @@
maven maven
upkgs.zig upkgs.zig
vlang vlang
wine
])) ]))
(graphicalPackages (with pkgs; [ (desktopHomePackages (with pkgs; [
qbittorrent qbittorrent
thunderbird thunderbird
whatsapp-for-linux whatsapp-for-linux

View file

@ -1,6 +1,6 @@
{ ulib, ... }: with ulib; { ulib, ... }: with ulib;
systemConfiguration { desktopSystemConfiguration {
security.rtkit = enabled {}; security.rtkit = enabled {};
sound = enabled {}; sound = enabled {};

View file

@ -1,6 +1,6 @@
{ ulib, pkgs, ... }: with ulib; { ulib, pkgs, ... }: with ulib;
graphicalConfiguration { desktopHomeConfiguration {
qt = enabled { qt = enabled {
platformTheme = "gnome"; platformTheme = "gnome";
style.name = "adwaita-dark"; style.name = "adwaita-dark";

View file

@ -1,10 +1,10 @@
{ inputs, ulib, pkgs, ... }: with ulib; merge { inputs, ulib, pkgs, ... }: with ulib; merge
(systemConfiguration { (desktopSystemConfiguration {
nixpkgs.overlays = [ inputs.fenix.overlays.default ]; nixpkgs.overlays = [ inputs.fenix.overlays.default ];
}) })
(systemPackages (with pkgs; [ (desktopSystemPackages (with pkgs; [
(fenix.complete.withComponents [ (fenix.complete.withComponents [
"cargo" "cargo"
"clippy" "clippy"

View file

@ -1,6 +1,7 @@
{ ulib, ... }: with ulib; { ulib, ... }: with ulib;
systemConfiguration { systemConfiguration {
# TODO: Move to cube host.
services.site = { # enabled { services.site = { # enabled {
openFirewall = true; openFirewall = true;
}; };

View file

@ -1,8 +1,8 @@
{ ulib, ... }: with ulib; { ulib, ... }: with ulib;
homeConfiguration { desktopHomeConfiguration {
programs.ssh = enabled { programs.ssh = enabled {
matchBlocks."*".setEnv.TERM = "xterm-kitty"; matchBlocks."*".setEnv.TERM = "xterm-kitty";
matchBlocks.cube = { matchBlocks.cube = {
hostname = "5.255.78.70"; hostname = "5.255.78.70";

View file

@ -1,12 +1,12 @@
{ ulib, pkgs, ... }: with ulib; merge { ulib, pkgs, ... }: with ulib; merge
(systemConfiguration { (desktopSystemConfiguration {
# Steam uses 32-bit drivers for some unholy fucking reason. # Steam uses 32-bit drivers for some unholy fucking reason.
hardware.opengl.driSupport32Bit = true; hardware.opengl.driSupport32Bit = true;
nixpkgs.config.allowUnfree = true; nixpkgs.config.allowUnfree = true;
}) })
(graphicalPackages (with pkgs; [ (desktopHomePackages (with pkgs; [
steam steam
])) ]))

View file

@ -3,7 +3,7 @@
systemConfiguration { systemConfiguration {
security.sudo = enabled { security.sudo = enabled {
extraConfig = '' extraConfig = ''
Defaults timestamp_timeout=-1 Defaults timestamp_timeout=${if ulib.isDesktop then "-1" else "0"}
''; '';
execWheelOnly = true; execWheelOnly = true;
}; };

View file

@ -1,12 +1,12 @@
{ ulib, theme, ... }: with ulib; { ulib, theme, ... }: with ulib;
graphicalConfiguration { desktopHomeConfiguration {
programs.waybar = with theme.withHashtag; enabled { programs.waybar = with theme.withHashtag; enabled {
systemd = enabled {}; systemd = enabled {};
settings = [{ settings = [{
layer = "top"; layer = "top";
height = 2 * corner-radius; height = 2 * cornerRadius;
margin-right = margin; margin-right = margin;
margin-left = margin; margin-left = margin;
@ -124,7 +124,7 @@ graphicalConfiguration {
style = '' style = ''
* { * {
border: none; border: none;
border-radius: ${toString corner-radius}px; border-radius: ${toString cornerRadius}px;
font-family: "${font.sans.name}"; font-family: "${font.sans.name}";
} }