organise all options into modules

This commit is contained in:
atagen 2024-05-08 15:05:43 +10:00
parent c7c6606d14
commit 3192b6ca09
43 changed files with 518 additions and 423 deletions

2
TODO
View file

@ -1,5 +1,7 @@
implement agenix
separate stable-diffusion and ollama backends from their UIs
figure out a way to get firefox policies and plugins set up in webapps
is theme gen relevant with cosmic?

89
flake.lock generated
View file

@ -90,11 +90,11 @@
"nixpkgs-lib": "nixpkgs-lib_2"
},
"locked": {
"lastModified": 1712014858,
"narHash": "sha256-sB4SWl2lX95bExY2gMFG5HIzvva5AVMJd4Igm+GpZNw=",
"lastModified": 1714606777,
"narHash": "sha256-bMkNmAXLj8iyTvxaaD/StcLSadbj1chPcJOjtuVnLmA=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "9126214d0a59633752a136528f5f3b9aa8565b7d",
"rev": "4d34ce6412bc450b1d4208c953dc97c7fc764f1a",
"type": "github"
},
"original": {
@ -237,11 +237,11 @@
"rust-overlay": "rust-overlay"
},
"locked": {
"lastModified": 1714450407,
"narHash": "sha256-OYLQkzwEr2ON83j9ZcR2JY8aSY1XT9SlN0POCn4gxAM=",
"lastModified": 1715014280,
"narHash": "sha256-70dgc0r7vCVkp93yTwzaQ7Xfh9cE63t+0mCVbreK8SQ=",
"owner": "helix-editor",
"repo": "helix",
"rev": "752ed8eb15b7366ef0c9e835b261189141e38630",
"rev": "beb5afcbef9f102c209de7aa32f126ded9dda515",
"type": "github"
},
"original": {
@ -257,11 +257,11 @@
]
},
"locked": {
"lastModified": 1714515075,
"narHash": "sha256-azMK7aWH0eUc3IqU4Fg5rwZdB9WZBvimOGG3piqvtsY=",
"lastModified": 1714981474,
"narHash": "sha256-b3/U21CJjCjJKmA9WqUbZGZgCvospO3ArOUTgJugkOY=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "6d3b6dc9222c12b951169becdf4b0592ee9576ef",
"rev": "6ebe7be2e67be7b9b54d61ce5704f6fb466c536f",
"type": "github"
},
"original": {
@ -293,11 +293,11 @@
]
},
"locked": {
"lastModified": 1714273701,
"narHash": "sha256-bmoeZ5zMSSO/e8P51yjrzaxA9uzA3SZAEFvih6S3LFo=",
"lastModified": 1714878592,
"narHash": "sha256-E68C03sYRsYFsK7wiGHUIJm8IsyPRALOrFoTL0glXnI=",
"owner": "Mic92",
"repo": "nix-index-database",
"rev": "941c4973c824509e0356be455d89613611f76c8a",
"rev": "a362555e9dbd4ecff3bb98969bbdb8f79fe87f10",
"type": "github"
},
"original": {
@ -315,11 +315,11 @@
]
},
"locked": {
"lastModified": 1714253190,
"narHash": "sha256-+9BSaBDbz3N65KgFhyJLXsIazYmpA4CUVcL4u29BIC0=",
"lastModified": 1714987925,
"narHash": "sha256-8gG1yIsha3bOUNs2cyOrC1I2E30G3R7bGoHsGO5bhkY=",
"owner": "nix-community",
"repo": "nix-ld-rs",
"rev": "d5939e6da59ea8a55b47ea48ce212f602a4fa59b",
"rev": "57342044b03b7faa4c949d492c80527ad693194c",
"type": "github"
},
"original": {
@ -372,11 +372,11 @@
"nixpkgs": "nixpkgs_2"
},
"locked": {
"lastModified": 1714536133,
"narHash": "sha256-zVRNhlvRaWxdwO1w77uZwolrUOCEA71OUtzlNwM+DEg=",
"lastModified": 1714622771,
"narHash": "sha256-fZs0u4ep+RH7U69Jo/GAjwd1iSVFSByeAOju8ucsPx8=",
"owner": "nix-community",
"repo": "nixd",
"rev": "891b5487b7dba00c85de0ef79bbc29ffeb936005",
"rev": "af6bb716038eecf5bad0ead6ed14a4c1e5b74c13",
"type": "github"
},
"original": {
@ -393,11 +393,11 @@
]
},
"locked": {
"lastModified": 1714582465,
"narHash": "sha256-qeQpjgbqJ7Fe8zzt2pBrzncGxr52QbFRbkaRh6tA2c8=",
"lastModified": 1714980446,
"narHash": "sha256-SZLOdVXaCIxbtS8fwuKG2tbczQ5ta4UpjfL/64FSLAk=",
"owner": "lilyinstarlight",
"repo": "nixos-cosmic",
"rev": "8f5f08a8718e990814fb371b9637f4e66318edae",
"rev": "b24b3344f0eab00503da8c99ad546539699bbdd5",
"type": "github"
},
"original": {
@ -440,11 +440,11 @@
"nixpkgs-lib_2": {
"locked": {
"dir": "lib",
"lastModified": 1711703276,
"narHash": "sha256-iMUFArF0WCatKK6RzfUJknjem0H9m4KgorO/p3Dopkk=",
"lastModified": 1714253743,
"narHash": "sha256-mdTQw2XlariysyScCv2tTE45QSU9v/ezLcHJ22f0Nxc=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "d8fe5e6c92d0d190646fb9f1056741a229980089",
"rev": "58a1abdbae3217ca6b702f03d3b35125d88a2994",
"type": "github"
},
"original": {
@ -471,29 +471,13 @@
"type": "github"
}
},
"nixpkgs-stable_2": {
"locked": {
"lastModified": 1704290814,
"narHash": "sha256-LWvKHp7kGxk/GEtlrGYV68qIvPHkU9iToomNFGagixU=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "70bdadeb94ffc8806c0570eb5c2695ad29f0e421",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-23.05",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_2": {
"locked": {
"lastModified": 1713596654,
"narHash": "sha256-LJbHQQ5aX1LVth2ST+Kkse/DRzgxlVhTL1rxthvyhZc=",
"lastModified": 1714562304,
"narHash": "sha256-Mr3U37Rh6tH0FbaDFu0aZDwk9mPAe7ASaqDOGgLqqLU=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "fd16bb6d3bcca96039b11aa52038fafeb6e4f4be",
"rev": "bcd44e224fd68ce7d269b4f44d24c2220fd821e7",
"type": "github"
},
"original": {
@ -505,11 +489,11 @@
},
"nixpkgs_3": {
"locked": {
"lastModified": 1714253743,
"narHash": "sha256-mdTQw2XlariysyScCv2tTE45QSU9v/ezLcHJ22f0Nxc=",
"lastModified": 1714906307,
"narHash": "sha256-UlRZtrCnhPFSJlDQE7M0eyhgvuuHBTe1eJ9N9AQlJQ0=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "58a1abdbae3217ca6b702f03d3b35125d88a2994",
"rev": "25865a40d14b3f9cf19f19b924e2ab4069b09588",
"type": "github"
},
"original": {
@ -521,11 +505,11 @@
},
"nur": {
"locked": {
"lastModified": 1714596740,
"narHash": "sha256-V3ZR38xu3JSUrg04wMTp0fzDSP+ogNJOOU5ckreCzLQ=",
"lastModified": 1715035541,
"narHash": "sha256-H8w0GhZxBpMzjY5HEaT5S/tnhsKx4lACUW4UPAi9DcI=",
"owner": "nix-community",
"repo": "NUR",
"rev": "c8456769a0904ac761020a76bf0bb72a92c27c7c",
"rev": "590b4fc898660027bfa5baf09cebb0dc87f49ed5",
"type": "github"
},
"original": {
@ -572,7 +556,6 @@
"nixd": "nixd",
"nixos-cosmic": "nixos-cosmic",
"nixpkgs": "nixpkgs_3",
"nixpkgs-stable": "nixpkgs-stable_2",
"nur": "nur",
"rust-overlay": "rust-overlay_2"
}
@ -612,11 +595,11 @@
]
},
"locked": {
"lastModified": 1714529851,
"narHash": "sha256-YMKJW880f7LHXVRzu93xa6Ek+QLECIu0IRQbXbzZe38=",
"lastModified": 1714961776,
"narHash": "sha256-LiIxWRKbm1DZ+7l1a6FMmIO8leQx5yrRLIApCMai1DY=",
"owner": "oxalica",
"repo": "rust-overlay",
"rev": "9ca720fdcf7865385ae3b93ecdf65f1a64cb475e",
"rev": "f3b20ea4131408ea585bddb1f41f91c4de9499cf",
"type": "github"
},
"original": {

View file

@ -3,7 +3,6 @@
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
nixpkgs-stable.url = "github:NixOS/nixpkgs/nixos-23.05";
nur.url = "github:/nix-community/NUR";
@ -52,7 +51,6 @@
outputs = {
self,
nixpkgs,
nixpkgs-stable,
nixos-cosmic,
home-manager,
nur,
@ -66,10 +64,7 @@
...
} @ inputs: let
inherit (self) outputs;
forAllSystems = nixpkgs.lib.genAttrs [
"x86_64-linux"
];
in rec {
in {
overlays = import ./util/overlay.nix {inherit inputs;};
nixosConfigurations = {

View file

@ -9,51 +9,14 @@
imports = [
./home.nix
./util/local-webapp.nix
./programs/stable-diffusion.nix
./programs/ollama.nix
];
home = {
username = "bolt";
homeDirectory = "/home/bolt";
packages = with pkgs; [
nicotine-plus
];
};
localWebApps = {
stable-diffusion = {
name = "Stable Diffusion (ComfyUI)";
genericName = "Stable Diffusion";
icon = ./icons/comfyui.png;
id = 5;
port = 7860;
service = {
WorkingDirectory = "${config.home.homeDirectory}/code/etc/stable-diffusion-webui-docker";
ExecStart = "${lib.getExe pkgs.docker} compose --profile comfy up --build";
};
};
openwebui = rec {
name = "Ollama (OpenWebUI)";
genericName = "Ollama";
icon = ./icons/openwebui.png;
id = 6;
port = 3021;
service = let
docker = lib.getExe pkgs.docker;
in {
Type = "exec";
ExecStartPre = "${pkgs.writeShellScript "openwebui-check" ''
set -euo pipefail
echo Checking for container existence..
if [[ $(${docker} inspect openwebui &> /dev/null; printf $?) -ne 0 ]]; then
echo Not found. Creating OpenWebUI/Ollama container..
${docker} create -e PORT=${builtins.toString port} --network host --gpus all -v ollama:/root/.ollama -v open-webui:/app/backend/data --name openwebui --restart always ghcr.io/open-webui/open-webui:ollama
fi
echo Check complete.
''}";
ExecStart = "${docker} start -a openwebui";
ExecStop = "${docker} stop openwebui";
};
};
};
services.flatpak.packages = ["org.nicotine_plus.Nicotine"];
}

View file

@ -1,79 +1,33 @@
{
inputs,
outputs,
lib,
config,
pkgs,
...
}: let
palette-hex = pkgs.lib.nix-rice.palette.toRgbHex pkgs.rice.palette;
palette-shex = pkgs.lib.nix-rice.palette.toRGBShortHex pkgs.rice.palette;
inherit (lib) getExe;
in {
home.stateVersion = "22.11";
imports = [
./programs/helix.nix
./programs/firefox.nix
./programs/kitty.nix
./programs/zsh.nix
./programs/cli.nix
./programs/desktop.nix
./programs/dev.nix
./programs/theming.nix
./util/ez.nix
./util/firefox-webapp.nix
# inputs.plasma-manager.homeManagerModules.plasma-manager
# ./programs/plasma.nix
inputs.nix-index-database.hmModules.nix-index
];
nix.gc = {
automatic = true;
frequency = "weekly";
options = "--delete-older-than 7d";
frequency = "daily";
options = "--delete-older-than 3d";
};
xdg.enable = true;
home.packages = with pkgs;
[
thunderbird
strawberry
inkscape
imv
zathura
btop
bat
ripgrep
fd
lazygit
fzf
zoxide
zellij
libnotify
playerctl
# kooha
croc
xorg.xrdb
culr
tuxguitar
# kdeconnect
# plasma-browser-integration
keepassxc
git-credential-keepassxc
direnv
mpv
gtk-engine-murrine
# polonium-pkgs.pkgs.plasma5Packages.polonium
]
++ pkgs.rice.fonts.pkgs
++ pkgs.rice.icons.pkgs;
rice.fonts.pkgs
++ rice.icons.pkgs;
systemd.user.targets.tray = {
Unit = {
@ -82,80 +36,12 @@ in {
};
};
fonts.fontconfig.enable = true;
services.syncthing = {
enable = true;
};
services.udiskie.enable = true;
services.flatpak = {
enable = true;
uninstallUnmanaged = true;
update.auto.enable = true;
packages = [
"md.obsidian.Obsidian"
"org.onlyoffice.desktopeditors"
];
overrides = {
global = {
Context.sockets = ["wayland"];
Environment = {
ELECTRON_OZONE_PLATFORM_HINT = "auto";
};
};
"md.obsidian.Obsidian" = {
Environment = {
OBSIDIAN_DISABLE_GPU = "1";
};
};
};
};
programs.firefox.webapps = {
"Microsoft-Teams" = {
url = "https://teams.microsoft.com";
id = 1;
extraSettings = config.programs.firefox.profiles.default.settings;
name = "Microsoft Teams";
icon = ./icons/ms_teams.png;
};
"Facebook-Messenger" = {
url = "https://www.messenger.com";
id = 2;
extraSettings = config.programs.firefox.profiles.default.settings;
name = "Facebook Messenger";
icon = ./icons/fb_msg.png;
};
"Syncthing" = {
url = "http://127.0.0.1:8384";
id = 3;
extraSettings = config.programs.firefox.profiles.default.settings;
name = "Syncthing";
icon = ./icons/syncthing.png;
};
"StudyTAFE" = {
url = "https://www.studytafensw.edu.au";
id = 4;
extraSettings = config.programs.firefox.profiles.default.settings;
name = "TAFE Study";
icon = ./icons/tafe.jpg;
};
};
programs.atuin = {
enable = true;
enableZshIntegration = true;
settings = {
inline_height = 20;
show_preview = true;
show_help = false;
enter_accept = false;
keymap_mode = "vim-normal";
style = "compact";
};
};
# programs.nix-index-database.comma.enable = true;
# programs.nix-index = {
# enable = true;
@ -165,108 +51,8 @@ in {
# programs.command-not-found.enable = false;
# programs.nix-index.enable = true;
programs.vscode = {
enable = true;
extensions = with pkgs.vscode-extensions; [
rust-lang.rust-analyzer
serayuzgur.crates
jnoortheen.nix-ide
arrterian.nix-env-selector
mkhl.direnv
# silverquark.dancehelix
# gregoire.dance
];
mutableExtensionsDir = true;
userSettings = {
"window.titleBarStyle" = "custom";
"editor.fontFamily" = "${pkgs.rice.fonts.monospace.name}";
"editor.fontSize" = 12;
"workbench.colorTheme" = "KanagawaTheme";
"rust-analyzer.check.overrideCommand" = "clippy";
"rust-analyzer.debug.engine" = "vadimcn.vscode-lldb";
"rust-analyzer.inlayHints.chainingHints.enable" = false;
"rust-analyzer.inlayHints.parameterHints.enable" = false;
"rust-analyzer.inlayHints.typeHints.enable" = false;
};
};
systemd.user.startServices = "sd-switch";
ezServices = with pkgs; {
ckb-next = "${lib.getExe ckb-next} -c -b";
ezServices = {
ckb-next = "${getExe pkgs.ckb-next} -c -b";
};
ezOneShots = with pkgs; {
xrdb = "${lib.getExe xorg.xrdb} -load ${config.home.homeDirectory}/.Xresources";
};
xdg.enable = true;
xresources.properties = with palette-hex; {
"*.foreground" = util.fg;
"*.background" = util.bg;
"*.cursorColor" = util.cursor;
"*.selection_foreground" = util.fg_sel;
"*.selection_background" = util.bg_sel;
"*.color0" = normal.black;
"*.color1" = normal.red;
"*.color2" = normal.green;
"*.color3" = normal.yellow;
"*.color4" = normal.blue;
"*.color5" = normal.magenta;
"*.color6" = normal.cyan;
"*.color7" = normal.white;
"*.color8" = bright.black;
"*.color9" = bright.red;
"*.color10" = bright.green;
"*.color11" = bright.yellow;
"*.color12" = bright.blue;
"*.color13" = bright.magenta;
"*.color14" = bright.cyan;
"*.color15" = bright.white;
};
xdg.systemDirs.data = [
"${pkgs.gtk3}/share/gsettings-schemas/${pkgs.gtk3.name}"
"${pkgs.gsettings-desktop-schemas}/share/gsettings-schemas/${pkgs.gsettings-desktop-schemas.name}"
];
# gtk = with pkgs.rice; {
# enable = true;
# theme = with gtk-theme; {
# inherit package name;
# };
# iconTheme = with icons; {
# inherit package name;
# };
# font = with fonts.sans; {
# inherit name size package;
# };
# };
programs.direnv = {
enable = true;
nix-direnv = {
enable = true;
};
};
programs.git = {
enable = true;
userName = "atagen";
userEmail = "atagen@boss.co";
extraConfig = {
credential.helper = "keepassxc";
};
};
# programs.fzf = {
# enable = true;
# enableZshIntegration = true;
# colors = with palette-hex; {
# fg = util.fg;
# bg = util.bg;
# hl = util.bg_sel;
# "fg+" = util.fg_sel;
# "bg+" = util.bg_sel;
# "hl+" = bright.green;
# };
# };
}

16
home/programs/atuin.nix Normal file
View file

@ -0,0 +1,16 @@
{...}:
{
programs.atuin = {
enable = true;
enableZshIntegration = true;
settings = {
inline_height = 20;
show_preview = true;
show_help = false;
enter_accept = false;
keymap_mode = "vim-normal";
style = "compact";
};
};
}

18
home/programs/cli.nix Normal file
View file

@ -0,0 +1,18 @@
{pkgs, ...}: {
imports = [
./kitty.nix
./zsh.nix
./xresources.nix
./helix.nix
./atuin.nix
];
home.packages = with pkgs; [
btop
bat
ripgrep
fd
lazygit
zoxide
zellij
];
}

View file

@ -0,0 +1,7 @@
{...}: {
flatpaks = [
"ar.com.tuxguitar.TuxGuitar"
"org.inkscape.Inkscape"
"com.github.PintaProject.Pinta"
];
}

17
home/programs/desktop.nix Normal file
View file

@ -0,0 +1,17 @@
{pkgs, ...}: {
imports = [
./media-players.nix
./firefox.nix
./flatpak.nix
./webapps.nix
./vscode.nix
./documents.nix
./creative.nix
];
home.packages = with pkgs; [
gnome.file-roller
gnome.nautilus
thunderbird
keepassxc
];
}

22
home/programs/dev.nix Normal file
View file

@ -0,0 +1,22 @@
{pkgs, ...}: {
home.packages = with pkgs; [
git-credential-keepassxc
direnv
];
programs.direnv = {
enable = true;
nix-direnv = {
enable = true;
};
};
programs.git = {
enable = true;
userName = "atagen";
userEmail = "atagen@boss.co";
extraConfig = {
credential.helper = "keepassxc";
};
};
}

View file

@ -0,0 +1,15 @@
{...}: {
flatpaks = [
{
name = "md.obsidian.Obsidian";
overrides = {
Environment = {
OBSIDIAN_DISABLE_GPU = "1";
};
};
}
# "org.onlyoffice.desktopeditors"
"org.libreoffice.LibreOffice"
"com.jgraph.drawio.desktop"
];
}

View file

@ -16,7 +16,7 @@
Status = "locked";
};
in {
config.programs.firefox = {
programs.firefox = {
enable = true;
policies = {

63
home/programs/flatpak.nix Normal file
View file

@ -0,0 +1,63 @@
{
config,
lib,
...
}: let
inherit (lib) mkOption;
inherit (builtins) typeOf listToAttrs;
in {
options.flatpaks = mkOption {
default = [];
type = with lib.types;
listOf (either str (submodule {
options = {
name = mkOption {
type = str;
};
overrides = mkOption {
type = attrsOf (attrsOf (either str (listOf str)));
default = {};
};
};
}));
};
config.services.flatpak = let
userOverrides = listToAttrs (
map (
fp:
if (typeOf fp == "string")
then {
name = fp;
value = {};
}
else {
inherit (fp) name;
value = fp.overrides;
}
)
config.flatpaks
);
in {
enable = true;
uninstallUnmanaged = true;
update.auto.enable = true;
packages =
map (
fp:
if (typeOf fp == "set")
then fp.name
else fp
)
config.flatpaks;
overrides =
userOverrides
// {
global = {
Context.sockets = ["wayland"];
Environment = {
ELECTRON_OZONE_PLATFORM_HINT = "auto";
};
};
};
};
}

View file

@ -7,7 +7,7 @@
palette-hex = pkgs.lib.nix-rice.palette.toRgbHex pkgs.rice.palette;
palette-shex = pkgs.lib.nix-rice.palette.toRGBShortHex pkgs.rice.palette;
in {
config.programs.helix = {
programs.helix = {
enable = true;
themes = with palette-hex; {
nix-rice = {

View file

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 11 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 183 KiB

After

Width:  |  Height:  |  Size: 183 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 135 KiB

After

Width:  |  Height:  |  Size: 135 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 5.1 KiB

After

Width:  |  Height:  |  Size: 5.1 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 86 KiB

After

Width:  |  Height:  |  Size: 86 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 103 KiB

After

Width:  |  Height:  |  Size: 103 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 152 KiB

After

Width:  |  Height:  |  Size: 152 KiB

Before After
Before After

View file

@ -0,0 +1,10 @@
{pkgs, ...}: {
home.packages = with pkgs; [
mpv
imv
strawberry
zathura
# libnotify
playerctl
];
}

35
home/programs/ollama.nix Normal file
View file

@ -0,0 +1,35 @@
{
lib,
pkgs,
...
}: let
inherit (lib) getExe;
inherit (builtins) toString;
inherit (pkgs) writeShellScript;
in {
localWebApps = {
openwebui = rec {
name = "Ollama (OpenWebUI)";
genericName = "Ollama";
icon = ./icons/openwebui.png;
id = 6;
port = 3021;
service = let
docker = getExe pkgs.docker;
in {
Type = "exec";
ExecStartPre = "${writeShellScript "openwebui-check" ''
set -euo pipefail
echo Checking for container existence..
if [[ $(${docker} inspect openwebui &> /dev/null; printf $?) -ne 0 ]]; then
echo Not found. Creating OpenWebUI/Ollama container..
${docker} create -e PORT=${toString port} --network host --gpus all -v ollama:/root/.ollama -v open-webui:/app/backend/data --name openwebui --restart always ghcr.io/open-webui/open-webui:ollama
fi
echo Check complete.
''}";
ExecStart = "${docker} start -a openwebui";
ExecStop = "${docker} stop openwebui";
};
};
};
}

View file

@ -0,0 +1,23 @@
{
lib,
pkgs,
config,
...
}: let
inherit (lib) getExe;
inherit (config.home) homeDirectory;
in {
localWebApps = {
stable-diffusion = {
name = "Stable Diffusion (ComfyUI)";
genericName = "Stable Diffusion";
icon = ./icons/comfyui.png;
id = 5;
port = 7860;
service = {
WorkingDirectory = "${homeDirectory}/code/etc/stable-diffusion-webui-docker";
ExecStart = "${getExe pkgs.docker} compose --profile comfy up --build";
};
};
};
}

30
home/programs/theming.nix Normal file
View file

@ -0,0 +1,30 @@
{pkgs, ...}: {
home.packages = with pkgs; [
gtk-engine-murrine
];
fonts.fontconfig.enable = true;
qt = {
enable = true;
style.name = "adwaita-dark";
platformTheme.name = "adwaita";
};
gtk = with pkgs;
with rice; {
enable = true;
# theme = with gtk-theme; {
# inherit package name;
# };
theme = {
name = "adw-gtk3-dark";
package = adw-gtk3; # cosmic
};
iconTheme = with icons; {
inherit package name;
};
font = with fonts.sans; {
inherit name size package;
};
};
}

26
home/programs/vscode.nix Normal file
View file

@ -0,0 +1,26 @@
{pkgs, ...}: {
programs.vscode = {
enable = true;
extensions = with pkgs.vscode-extensions; [
rust-lang.rust-analyzer
serayuzgur.crates
jnoortheen.nix-ide
arrterian.nix-env-selector
mkhl.direnv
# silverquark.dancehelix
# gregoire.dance
];
mutableExtensionsDir = true;
userSettings = {
"window.titleBarStyle" = "custom";
"editor.fontFamily" = "${pkgs.rice.fonts.monospace.name}";
"editor.fontSize" = 12;
"workbench.colorTheme" = "KanagawaTheme";
"rust-analyzer.check.overrideCommand" = "clippy";
"rust-analyzer.debug.engine" = "vadimcn.vscode-lldb";
"rust-analyzer.inlayHints.chainingHints.enable" = false;
"rust-analyzer.inlayHints.parameterHints.enable" = false;
"rust-analyzer.inlayHints.typeHints.enable" = false;
};
};
}

35
home/programs/webapps.nix Normal file
View file

@ -0,0 +1,35 @@
{config, ...}: {
imports = [
../util/firefox-webapp.nix
];
programs.firefox.webapps = {
"Microsoft-Teams" = {
url = "https://teams.microsoft.com";
id = 1;
extraSettings = config.programs.firefox.profiles.default.settings;
name = "Microsoft Teams";
icon = ./icons/ms_teams.png;
};
"Facebook-Messenger" = {
url = "https://www.messenger.com";
id = 2;
extraSettings = config.programs.firefox.profiles.default.settings;
name = "Facebook Messenger";
icon = ./icons/fb_msg.png;
};
"Syncthing" = {
url = "http://127.0.0.1:8384";
id = 3;
extraSettings = config.programs.firefox.profiles.default.settings;
name = "Syncthing";
icon = ./icons/syncthing.png;
};
"StudyTAFE" = {
url = "https://www.studytafensw.edu.au";
id = 4;
extraSettings = config.programs.firefox.profiles.default.settings;
name = "TAFE Study";
icon = ./icons/tafe.jpg;
};
};
}

View file

@ -7,7 +7,7 @@
palette-hex = pkgs.lib.nix-rice.palette.toRgbHex pkgs.rice.palette;
palette-shex = pkgs.lib.nix-rice.palette.toRGBShortHex pkgs.rice.palette;
in {
config.programs.wlogout = {
programs.wlogout = {
enable = true;
layout = builtins.fromJSON (builtins.readFile ../dots/wlogout/layout);
style = with palette-hex; (builtins.replaceStrings

View file

@ -0,0 +1,41 @@
{
pkgs,
lib,
config,
...
}: let
inherit (lib) getExe;
inherit (config.home) homeDirectory;
palette-hex = pkgs.lib.nix-rice.palette.toRgbHex pkgs.rice.palette;
in {
ezOneShots = with pkgs; {
xrdb = "${getExe xorg.xrdb} -load ${homeDirectory}/.Xresources";
};
home.packages = with pkgs; [
xorg.xrdb
culr
];
xresources.properties = with palette-hex; {
"*.foreground" = util.fg;
"*.background" = util.bg;
"*.cursorColor" = util.cursor;
"*.selection_foreground" = util.fg_sel;
"*.selection_background" = util.bg_sel;
"*.color0" = normal.black;
"*.color1" = normal.red;
"*.color2" = normal.green;
"*.color3" = normal.yellow;
"*.color4" = normal.blue;
"*.color5" = normal.magenta;
"*.color6" = normal.cyan;
"*.color7" = normal.white;
"*.color8" = bright.black;
"*.color9" = bright.red;
"*.color10" = bright.green;
"*.color11" = bright.yellow;
"*.color12" = bright.blue;
"*.color13" = bright.magenta;
"*.color14" = bright.cyan;
"*.color15" = bright.white;
};
}

View file

@ -22,7 +22,7 @@
default = {};
};
# for launching a systemd target on wm startup
# for specifying an additional systemd target
extraTarget = with lib;
mkOption {
type = with types; listOf str;

View file

@ -4,7 +4,7 @@
...
}: let
inherit (builtins) getAttr stringLength substring;
inherit (lib) mkOption;
inherit (lib) mkOption getExe;
inherit (lib.attrsets) filterAttrs mapAttrs mapAttrs' nameValuePair;
inherit (lib.strings) concatStringsSep toUpper;
@ -190,7 +190,7 @@ in {
type = "Application";
exec = concatStringsSep " " ([
"${lib.getExe config.programs.firefox.package}"
"${getExe config.programs.firefox.package}"
"--name"
"${name}"
"--app-id"

View file

@ -6,6 +6,7 @@
}: let
inherit (lib) mkOption;
inherit (lib.attrsets) mapAttrs mapAttrs' nameValuePair;
inherit (lib) getExe getExe';
# make a firefox webapp entry for the client app
make-firefox = cfg:
mapAttrs' (
@ -35,10 +36,10 @@
inherit (cfg) name icon genericName;
type = "Application";
exec = "${let
notify-send = "${lib.getExe' pkgs.libnotify "notify-send"} -a \"${cfg.name}\"";
systemctl = "${lib.getExe' pkgs.systemd "systemctl"}";
dex = "${lib.getExe pkgs.dex}";
curl = "${lib.getExe pkgs.curl}";
notify-send = "${getExe' pkgs.libnotify "notify-send"} -a \"${cfg.name}\"";
systemctl = "${getExe' pkgs.systemd "systemctl"}";
dex = "${getExe pkgs.dex}";
curl = "${getExe pkgs.curl}";
in
pkgs.writeShellScript "${name}"
''

View file

@ -10,5 +10,8 @@
imports = lib.mapAttrsToList toImport (lib.filterAttrs filterCaches (builtins.readDir folder));
in {
inherit imports;
nix.settings.substituters = ["https://cache.nixos.org/"];
nix.settings = {
substituters = ["https://cache.nixos.org" " https://cache.nixos.org/" "https://cosmic.cachix.org/" "https://nix-community.cachix.org" " https://helix.cachix.org" "https://cosmic.cachix.org"];
trusted-public-keys = ["cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=" "cosmic.cachix.org-1:Dya9IyXD4xdBehWjrkPv6rtxpmMdRel02smYzA85dPE=" "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" "helix.cachix.org-1:ejp9KQpR1FBI2onstMQ34yogDm4OgU2ru6lIwPvuCVs="];
};
}

View file

@ -8,6 +8,7 @@
nix-std,
...
}: {
# these settings propagate to home-manager's nixpkgs
nixpkgs = {
overlays = [
inputs.nur.overlay
@ -31,8 +32,6 @@
trusted-users = ["bolt" "plank"];
experimental-features = "nix-command flakes";
substitute = true;
substituters = ["https://cosmic.cachix.org/"];
trusted-public-keys = ["cosmic.cachix.org-1:Dya9IyXD4xdBehWjrkPv6rtxpmMdRel02smYzA85dPE="];
};
extraOptions = ''
keep-outputs = true
@ -40,51 +39,40 @@
'';
gc = {
automatic = true;
dates = "weekly";
options = "--delete-older-than 7d";
dates = "daily";
options = "--delete-older-than 3d";
};
};
imports = [];
imports = [
./modules/network.nix
./modules/term.nix
./modules/cosmic.nix
./modules/systemdboot.nix
./modules/sound.nix
./modules/sydney.nix
./modules/docs.nix
./modules/nix-meta.nix
];
systemd.services.NetworkManager-wait-online.enable = true; # for some reason nm doesn't enable without this
environment.pathsToLink = ["/share/zsh"];
# hm should have sorted this out
# qt = {
# enable = true;
# style = "adwaita-dark";
# };
hardware.enableRedistributableFirmware = true;
hardware.enableAllFirmware = true;
boot.loader.systemd-boot.consoleMode = "max";
boot.loader.timeout = 3;
boot.loader.systemd-boot.enable = true;
boot.tmp.useTmpfs = true;
networking.networkmanager.enable = true; # Easiest to use and most distros use this by default.
time.timeZone = "Australia/Sydney";
# fix windows to use utc instead
time.hardwareClockInLocalTime = false;
# Select internationalisation properties.
i18n.defaultLocale = "en_AU.UTF-8";
i18n.supportedLocales = ["en_AU.UTF-8/UTF-8"];
console = {
font = "Lat2-Terminus16";
useXkbConfig = true; # use xkbOptions in tty.
};
services.libinput.enable = true;
hardware.opengl.enable = true;
hardware.opengl.driSupport32Bit = true;
#input stuff
services.libinput.enable = true;
services.desktopManager.cosmic.enable = true;
services.displayManager.cosmic-greeter.enable = true;
services.udisks2.enable = true;
services.system76-scheduler.enable = true;
services.flatpak.enable = true;
security.polkit.enable = true;
@ -92,73 +80,29 @@
xdg.autostart.enable = true;
xdg.portal.enable = true;
services.resolved = {
enable = true;
fallbackDns = ["103.1.206.179" "168.138.8.38" "168.138.12.137"];
dnssec = "false";
};
# Enable sound.
security.rtkit.enable = true;
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
};
programs.dconf.enable = true;
services.colord.enable = true;
programs.zsh.enable = true;
users.defaultUserShell = pkgs.zsh;
# services.tailscale.enable = true;
environment.systemPackages = with pkgs; [
man-pages
man-pages-posix
nixd
home-manager
cachix
curl
eza
swaybg
git
cachix
alejandra
];
services.atuin.enable = true;
documentation.dev.enable = true;
documentation.man.enable = true;
documentation.enable = true;
programs.nix-index-database.comma.enable = true;
programs.nix-index.enableZshIntegration = false;
programs.nix-index.enableBashIntegration = false;
# gnome/freedesktop compat stuff
programs.dconf.enable = true;
services.gvfs.enable = true;
services.mullvad-vpn.enable = true;
programs.nix-ld = {
enable = true;
package = pkgs.nix-ld-rs;
};
networking.firewall = {
checkReversePath = "loose";
};
# give cpuset to user
systemd.services."user@".serviceConfig.Delegate = "memory pids cpu cpuset";

View file

@ -0,0 +1,5 @@
{...}: {
services.desktopManager.cosmic.enable = true;
services.displayManager.cosmic-greeter.enable = true;
services.system76-scheduler.enable = true;
}

10
system/modules/docs.nix Normal file
View file

@ -0,0 +1,10 @@
{pkgs, ...}: {
environment.systemPackages = with pkgs; [
man-pages
man-pages-posix
];
documentation.dev.enable = true;
documentation.man.enable = true;
documentation.enable = true;
}

View file

@ -0,0 +1,13 @@
{...}: {
networking.networkmanager.enable = true; # Easiest to use and most distros use this by default.
systemd.services.NetworkManager-wait-online.enable = true; # for some reason nm doesn't enable without this
services.resolved = {
enable = true;
fallbackDns = ["103.1.206.179" "168.138.8.38" "168.138.12.137"];
dnssec = "false";
};
services.mullvad-vpn.enable = true;
networking.firewall = {
checkReversePath = "loose";
};
}

View file

@ -0,0 +1,8 @@
{pkgs, ...}: {
environment.systemPackages = with pkgs; [
nixd
home-manager
cachix
alejandra
];
}

9
system/modules/sound.nix Normal file
View file

@ -0,0 +1,9 @@
{...}: {
security.rtkit.enable = true;
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
};
}

View file

@ -0,0 +1,6 @@
{...}: {
time.timeZone = "Australia/Sydney";
time.hardwareClockInLocalTime = false;
i18n.defaultLocale = "en_AU.UTF-8";
i18n.supportedLocales = ["en_AU.UTF-8/UTF-8"];
}

View file

@ -0,0 +1,5 @@
{...}: {
boot.loader.systemd-boot.consoleMode = "max";
boot.loader.timeout = 3;
boot.loader.systemd-boot.enable = true;
}

8
system/modules/term.nix Normal file
View file

@ -0,0 +1,8 @@
{pkgs, ...}: {
environment.pathsToLink = ["/share/zsh"];
programs.zsh.enable = true;
users.defaultUserShell = pkgs.zsh;
console = {
font = "Lat2-Terminus16";
};
}

View file

@ -1,18 +1,18 @@
{
inputs,
outputs,
config,
lib,
pkgs,
overlays,
modulesPath,
...
}: {
imports = [
./configuration.nix
# ../ollama.nix
];
users.users.bolt = {
isNormalUser = true;
extraGroups = ["wheel" "podman" "docker"]; # Enable sudo for the user.
};
boot.initrd.availableKernelModules = ["xhci_pci" "ahci" "usbcore" "sd_mod"];
boot.initrd.kernelModules = [];
boot.initrd.systemd.enable = true;
@ -118,10 +118,6 @@
];
networking.hostName = "quiver"; # Define your hostname.
users.users.bolt = {
isNormalUser = true;
extraGroups = ["wheel" "podman" "docker"]; # Enable sudo for the user.
};
fileSystems."/" = {
device = "/dev/disk/by-uuid/b993b463-c131-4ef1-9aba-0e3eadaa2f9a";