This commit is contained in:
Steph 2024-11-16 23:44:57 +01:00
commit fd17d28a05
12 changed files with 401 additions and 200 deletions

57
flake.lock generated
View File

@ -26,11 +26,11 @@
"firefox-gnome-theme": { "firefox-gnome-theme": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1723137499, "lastModified": 1728654484,
"narHash": "sha256-MOE9NeU2i6Ws1GhGmppMnjOHkNLl2MQMJmGhaMzdoJM=", "narHash": "sha256-J53bks/1loTdXiSQz1OlOAc8jx9g399oF1YiXAX2JKQ=",
"owner": "rafaelmardojai", "owner": "rafaelmardojai",
"repo": "firefox-gnome-theme", "repo": "firefox-gnome-theme",
"rev": "fb5b578a4f49ae8705e5fea0419242ed1b8dba70", "rev": "e53b84d428e7f5ba0f04d6a91e6cc6c05c75b632",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -39,6 +39,22 @@
"type": "github" "type": "github"
} }
}, },
"firefox-macos-theme": {
"flake": false,
"locked": {
"lastModified": 1729993006,
"narHash": "sha256-8YGR0HuMcxGQBDlhP+kUriYDOpP7geHvGc+sEu167Dk=",
"owner": "AdamXweb",
"repo": "WhiteSurFirefoxThemeMacOS",
"rev": "4665c5b6e03127597c7cf99d91b676c9d1fca95d",
"type": "github"
},
"original": {
"owner": "AdamXweb",
"repo": "WhiteSurFirefoxThemeMacOS",
"type": "github"
}
},
"flake-utils": { "flake-utils": {
"locked": { "locked": {
"lastModified": 1629284811, "lastModified": 1629284811,
@ -75,7 +91,38 @@
"type": "github" "type": "github"
} }
}, },
"nix-darwin": {
"inputs": {
"nixpkgs": "nixpkgs"
},
"locked": {
"lastModified": 1730070491,
"narHash": "sha256-+RYCbdU6l4E4pr40++lrdhdE3gNC/BR54AL7xWG/YRU=",
"owner": "LnL7",
"repo": "nix-darwin",
"rev": "5c0c6aaa797d6ccbb6cdab14de0248135735709d",
"type": "github"
},
"original": {
"id": "nix-darwin",
"type": "indirect"
}
},
"nixpkgs": { "nixpkgs": {
"locked": {
"lastModified": 1718149104,
"narHash": "sha256-Ds1QpobBX2yoUDx9ZruqVGJ/uQPgcXoYuobBguyKEh8=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "e913ae340076bbb73d9f4d3d065c2bca7caafb16",
"type": "github"
},
"original": {
"id": "nixpkgs",
"type": "indirect"
}
},
"nixpkgs_2": {
"locked": { "locked": {
"lastModified": 1727540905, "lastModified": 1727540905,
"narHash": "sha256-40J9tW7Y794J7Uw4GwcAKlMxlX2xISBl6IBigo83ih8=", "narHash": "sha256-40J9tW7Y794J7Uw4GwcAKlMxlX2xISBl6IBigo83ih8=",
@ -110,8 +157,10 @@
"inputs": { "inputs": {
"firefox-addons": "firefox-addons", "firefox-addons": "firefox-addons",
"firefox-gnome-theme": "firefox-gnome-theme", "firefox-gnome-theme": "firefox-gnome-theme",
"firefox-macos-theme": "firefox-macos-theme",
"home": "home", "home": "home",
"nixpkgs": "nixpkgs", "nix-darwin": "nix-darwin",
"nixpkgs": "nixpkgs_2",
"nur": "nur" "nur": "nur"
} }
} }

View File

@ -8,25 +8,25 @@
home.inputs.nixpkgs.follows = "nixpkgs"; home.inputs.nixpkgs.follows = "nixpkgs";
firefox-gnome-theme = { url = "github:rafaelmardojai/firefox-gnome-theme"; flake = false; }; firefox-gnome-theme = { url = "github:rafaelmardojai/firefox-gnome-theme"; flake = false; };
firefox-macos-theme = {url = "github:AdamXweb/WhiteSurFirefoxThemeMacOS"; flake = false; };
firefox-addons = { url = "gitlab:rycee/nur-expressions?dir=pkgs/firefox-addons"; inputs.nixpkgs.follows = "nixpkgs"; }; firefox-addons = { url = "gitlab:rycee/nur-expressions?dir=pkgs/firefox-addons"; inputs.nixpkgs.follows = "nixpkgs"; };
nur.url = "github:nix-community/NUR"; nur.url = "github:nix-community/NUR";
}; };
outputs = { self, nixpkgs, home, firefox-gnome-theme, firefox-addons, nur }@inputs: { outputs = { self, nixpkgs, home, firefox-gnome-theme, firefox-addons, nur, nix-darwin, firefox-macos-theme }@inputs: {
nixosConfigurations.iota = nixpkgs.lib.nixosSystem { nixosConfigurations.iota = nixpkgs.lib.nixosSystem {
system = "x86_64-linux"; system = "x86_64-linux";
modules = [ modules = [
home.nixosModules.home-manager home.nixosModules.home-manager
{ {
imports = [ imports = [
./configuration.nix ./nixos.nix
./hardware-configuration/iota.nix ./hardware-configuration/iota.nix
{_module.args = {inherit inputs;};} {_module.args = {inherit inputs;};}
]; ];
home-manager.users.steph = import ./home.nix; home-manager.users.steph = { imports = [ ./home.nix ./platforms/linux/home.nix ]; };
home-manager.useGlobalPkgs = true; home-manager.extraSpecialArgs = { inherit inputs ; os = "linux"; };
home-manager.extraSpecialArgs = { inherit inputs ; };
} }
]; ];
}; };
@ -36,16 +36,20 @@
home.nixosModules.home-manager home.nixosModules.home-manager
{ {
imports = [ imports = [
./configuration.nix ./nixos.nix
./hardware-configuration/tau.nix ./hardware-configuration/tau.nix
{_module.args = {inherit inputs;};} {_module.args = {inherit inputs;};}
]; ];
home-manager.users.steph = import ./home.nix; home-manager.users.steph = { imports = [ ./home.nix ./platforms/linux/home.nix ]; };
home-manager.useGlobalPkgs = true; home-manager.extraSpecialArgs = { inherit inputs ; os = "linux"; };
home-manager.extraSpecialArgs = { inherit inputs ; };
} }
]; ];
}; };
homeConfigurations.stephans = home.lib.homeManagerConfiguration rec {
pkgs = nixpkgs.legacyPackages."aarch64-darwin";
extraSpecialArgs = { inherit inputs ; os = "darwin"; };
modules = [ ./home.nix ./platforms/darwin/home.nix ];
};
}; };
} }

125
home.nix
View File

@ -1,130 +1,61 @@
{config, lib, pkgs, inputs, ...}: { {config, lib, pkgs, inputs, os, ...}: {
imports = [ imports = [
./programs/firefox.nix
./programs/tmux.nix ./programs/tmux.nix
./programs/bash.nix ./programs/bash.nix
./programs/kakoune.nix
./programs/pastebin.nix
./programs/helix.nix
./programs/firefox.nix
]; ];
options = {};
config = {
home.stateVersion = "22.05"; home.stateVersion = "22.05";
programs.home-manager.enable = true;
nixpkgs = {
config.allowUnfree = true;
overlays = [ inputs.nur.overlay ];
};
home.packages = with pkgs; [ home.packages = with pkgs; [
bat bat
bottom bottom
dino btop
direnv entr
element-desktop
endeavour
eza eza
fd fd
file file
foliate
fortune fortune
fragments
git git
gparted
htop htop
inkscape
lf
libreoffice
minetest
mpv
mumble
neovim neovim
nextcloud-client
nix-direnv
nodejs-18_x nodejs-18_x
obs-studio pandoc
openvpn
pinta
prismlauncher
ripgrep ripgrep
sequeler
skim
sqlite sqlite
sqlite.dev sqlite.dev
stack texliveFull
steam-run
syncplay
tdesktop
thunderbird
tmux
tuba
ungoogled-chromium
unzip unzip
vim vim
vscodium vscodium
wget wget
widevine-cdm
wl-clipboard
zip zip
zotero
thunderbird # fonts
signal-desktop (nerdfonts.override { fonts = [ "FiraCode" "DroidSansMono" ]; })
entr noto-fonts
pandoc noto-fonts-cjk
texliveFull noto-fonts-emoji
steam inter
google-fonts
vistafonts
]; ];
programs.home-manager.enable = true;
dconf.settings = {
"org/gnome/desktop/wm/keybindings" = {
move-to-workspace-left = ["<Alt><Super>Left"];
move-to-workspace-right = ["<Alt><Super>Right"];
switch-to-workspace-left = ["<Super>Left"];
switch-to-workspace-right = ["<Super>Right"];
switch-applications = ["<Super>Tab"];
switch-applications-backward = ["<Shift><Super>Tab"];
switch-windows = ["<Alt>Tab"];
switch-windows-backward = ["<Shift><Alt>Tab"];
};
"org/gnome/settings-daemon/plugins/media-keys" = {
custom-keybindings = ["/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0/"];
};
"org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0" = {
binding = "<Super>t";
command = "kgx";
name = "gnome-console";
};
"org/gnome/desktop/interface" = {
clock-show-weekday = true;
};
"org/gnome/desktop/peripherals/touchpad" = {
tap-to-click = true;
two-finger-scrolling-enabled = true;
};
"org/gnome/shell" = rec {
enabled-extensions = [
"trayIconsReloaded@selfmade.pl"
"AlphabeticalAppGrid@stuarthayhurst"
"clipboard-history@alexsaveau.dev"
"noannoyance@daase.net"
];
# disabled-extensions = builtins.filter (x: ! builtins.elem x enabled-extensions) disabled-extensions;
favorite-apps = [
"firefox.desktop"
"chromium-browser.desktop"
"org.gnome.Console.desktop"
"org.gnome.Nautilus.desktop"
"thunderbird.desktop"
"signal-desktop.desktop"
"element-desktop.desktop"
"org.telegram.desktop.desktop"
"im.dino.Dino.desktop"
];
};
"org/gnome/desktop/background" = {
"picture-uri" = "${config.home.homeDirectory}/.background-image";
};
};
home.file.".background-image".source = "${./.}/Morskie Oko.jpg";
home.file.".local/bin/git-identity" = { home.file.".local/bin/git-identity" = {
executable = true; executable = true;
source = "${./git-identity.sh}"; source = "${./git-identity.sh}";
}; };
};
} }

View File

@ -3,8 +3,7 @@
{ {
imports = imports =
[ [
./programs/kakoune.nix
./programs/pastebin.nix
]; ];
nix = { nix = {
@ -14,9 +13,7 @@
''; '';
}; };
nixpkgs.overlays = [
inputs.nur.overlay
];
networking.networkmanager.enable = true; networking.networkmanager.enable = true;
@ -79,41 +76,17 @@
description = "Steph"; description = "Steph";
extraGroups = [ "networkmanager" "wheel" "dialout" "podman" "docker" ]; extraGroups = [ "networkmanager" "wheel" "dialout" "podman" "docker" ];
packages = with pkgs; [ packages = with pkgs; [
# Use home-manager doofus
]; ];
}; };
networking.firewall.enable = false; #.allowedTCPPorts = [ 8080 ]; services.avahi.enable = false;
networking.extraHosts = ''
86.95.92.180 apprise.prod.gaiaplant.app
192.145.59.184 marshallingyard.steph.tools
'';
services.avahi.enable = true;
services.minidlna.settings.enable = true;
services.minidlna.settings.media_dir = [
"/media" ];
virtualisation.podman.enable = true; virtualisation.podman.enable = true;
virtualisation.docker.enable = true; virtualisation.docker.enable = true;
nixpkgs.config.allowUnfree = true;
fonts.packages = with pkgs; [
(nerdfonts.override { fonts = [ "FiraCode" "DroidSansMono" ]; })
noto-fonts
noto-fonts-cjk
noto-fonts-emoji
inter
google-fonts
vistafonts
];
environment.localBinInPath = true; environment.localBinInPath = true;
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
podman
docker-compose
fprintd fprintd
libfprint-2-tod1-vfs0090 libfprint-2-tod1-vfs0090
udev udev

View File

@ -0,0 +1,8 @@
{config, lib, pkgs, inputs, os, ...}: {
home.username = "stephans";
home.homeDirectory = "/Users/stephans";
home.packages = with pkgs; [
];
}

89
platforms/linux/home.nix Normal file
View File

@ -0,0 +1,89 @@
{config, lib, pkgs, inputs, os, ...}: {
imports = [
];
home.packages = with pkgs; [
element-desktop
# gnome apps
endeavour
foliate
fragments
gparted
inkscape
lf
libreoffice
minetest
mpv
mumble
nextcloud-client
obs-studio
openvpn
pinta
prismlauncher
sequeler
syncplay
tdesktop
thunderbird
tuba
ungoogled-chromium
widevine-cdm
wl-clipboard
zotero
signal-desktop
];
dconf.settings = {
"org/gnome/desktop/wm/keybindings" = {
move-to-workspace-left = ["<Alt><Super>Left"];
move-to-workspace-right = ["<Alt><Super>Right"];
switch-to-workspace-left = ["<Super>Left"];
switch-to-workspace-right = ["<Super>Right"];
switch-applications = ["<Super>Tab"];
switch-applications-backward = ["<Shift><Super>Tab"];
switch-windows = ["<Alt>Tab"];
switch-windows-backward = ["<Shift><Alt>Tab"];
};
"org/gnome/settings-daemon/plugins/media-keys" = {
custom-keybindings = ["/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0/"];
};
"org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0" = {
binding = "<Super>t";
command = "kgx";
name = "gnome-console";
};
"org/gnome/desktop/interface" = {
clock-show-weekday = true;
};
"org/gnome/desktop/peripherals/touchpad" = {
tap-to-click = true;
two-finger-scrolling-enabled = true;
};
"org/gnome/shell" = rec {
enabled-extensions = [
"trayIconsReloaded@selfmade.pl"
"AlphabeticalAppGrid@stuarthayhurst"
"clipboard-history@alexsaveau.dev"
"noannoyance@daase.net"
];
# disabled-extensions = builtins.filter (x: ! builtins.elem x enabled-extensions) disabled-extensions;
favorite-apps = [
"firefox.desktop"
"chromium-browser.desktop"
"org.gnome.Console.desktop"
"org.gnome.Nautilus.desktop"
"thunderbird.desktop"
"signal-desktop.desktop"
"element-desktop.desktop"
"org.telegram.desktop.desktop"
];
};
"org/gnome/desktop/background" = {
"picture-uri" = "${config.home.homeDirectory}/.background-image";
};
};
home.file.".background-image".source = "${./.}/Morskie Oko.jpg";
}

View File

@ -1,4 +1,4 @@
{config, lib, pkgs, inputs, ...} : { {config, lib, pkgs, inputs, os, ...} : {
programs.bash.enable = true; programs.bash.enable = true;
programs.bash.bashrcExtra = '' programs.bash.bashrcExtra = ''
if [ -n "$PS1" ]; then if [ -n "$PS1" ]; then
@ -26,7 +26,7 @@ $NEW_PROMPT_COMMAND"
export PS1="[\t \[\e[32m\]\u\[\e[m\]\[\e[32m\]@\[\e[m\]\[\e[32m\]\h\[\e[m\]]"'$SHELL_PREFIX'" \[\e[36m\]"'$TRIMMED_PWD'"\[\e[m\] \$ " export PS1="[\t \[\e[32m\]\u\[\e[m\]\[\e[32m\]@\[\e[m\]\[\e[32m\]\h\[\e[m\]]"'$SHELL_PREFIX'" \[\e[36m\]"'$TRIMMED_PWD'"\[\e[m\] \$ "
fi fi
eval "$(direnv hook bash)" eval "$(/opt/homebrew/bin/brew shellenv)"
''; '';
programs.bash.shellAliases = { programs.bash.shellAliases = {
chmod = "chmod --preserve-root"; chmod = "chmod --preserve-root";
@ -36,10 +36,13 @@ $NEW_PROMPT_COMMAND"
free = "free -h"; free = "free -h";
toupper = "tr [:lower:] [:upper:]"; toupper = "tr [:lower:] [:upper:]";
tolower = "tr [:upper:] [:lower:]"; tolower = "tr [:upper:] [:lower:]";
rebuild = '' rebuild = if (os == "linux") then ''
nixos-rebuild switch --flake "$HOME/.local/os#" --use-remote-sudo nixos-rebuild switch --flake "path:$HOME/.local/os#" --use-remote-sudo
'' else ''
home-manager switch
''; '';
":r" = "!!"; ":r" = "!!";
":wq" = "exit";
}; };
programs.bash.sessionVariables = { programs.bash.sessionVariables = {
NIX_SHELL_PRESERVE_PROMPT = 1; NIX_SHELL_PRESERVE_PROMPT = 1;

View File

@ -1,12 +1,34 @@
{config, lib, pkgs, inputs, ...} : { {config, lib, pkgs, inputs, os, ...} : lib.mkMerge [
home.file.".mozilla/firefox/default/chrome/firefox-gnome-theme".source = inputs.firefox-gnome-theme;
programs.firefox.enable = true; (lib.mkIf (os == "linux") {
programs.firefox.profiles.default = { home.file.".mozilla/firefox/default/chrome/theme".source =
userChrome = '' inputs.firefox-gnome-theme;
@import "firefox-gnome-theme/userChrome.css"; })
(lib.mkIf (os == "darwin") {
home.file."/Users/stephans/Library/Application Support/Firefox/Profiles/default/chrome/theme".source =
inputs.firefox-macos-theme;
})
{
programs.firefox = lib.mkMerge [
(lib.mkIf (os == "darwin") {
package = null;
})
{
enable = true;
profiles.default = {
isDefault = true;
userChrome = if (os == "linux") then ''
@import "theme/userChrome.css";
'' else ''
@import "theme/chrome/userChrome.css";
@import "theme/custom/singletabhidden.css";
''; '';
userContent = '' userContent = if (os == "linux") then ''
@import "firefox-gnome-theme/userContent.css"; @import "theme/userContent.css";
'' else ''
@import "theme/chrome/userContent.css";
''; '';
settings = { settings = {
"toolkit.legacyUserProfileCustomizations.stylesheets" = true; # Enable customChrome.cs "toolkit.legacyUserProfileCustomizations.stylesheets" = true; # Enable customChrome.cs
@ -18,23 +40,37 @@
"gnomeTheme.hideSingleTab" = true; "gnomeTheme.hideSingleTab" = true;
"signon.rememberSignons" = false; "signon.rememberSignons" = false;
"dom.private-attribution.submission.enabled" = false; "dom.private-attribution.submission.enabled" = false;
"app.update.auto" = false;
}; };
extensions = with pkgs.nur.repos.rycee.firefox-addons; [ extensions = with pkgs.nur.repos.rycee.firefox-addons; [
ublock-origin ublock-origin
bitwarden bitwarden
consent-o-matic consent-o-matic
sponsorblock
multi-account-containers
] ++ (if (os == "darwin") then [
onepassword-password-manager
] else [
wayback-machine wayback-machine
h264ify h264ify
sponsorblock
fediact fediact
multi-account-containers
tampermonkey tampermonkey
]; ]);
search = { search = {
default = "DuckDuckGo"; default = "DuckDuckGo";
force = true; force = true;
}; };
containers = { containers = {
"Personal" = {
color = "toolbar";
icon = "circle";
id = 0;
};
"ON2IT" = {
color = "toolbar";
icon = "circle";
id = 1;
};
"Lekker van Peet" = { "Lekker van Peet" = {
color = "toolbar"; color = "toolbar";
icon = "circle"; icon = "circle";
@ -43,4 +79,7 @@
}; };
containersForce = true; containersForce = true;
}; };
} }
];
}
]

74
programs/fish.nix Normal file
View File

@ -0,0 +1,74 @@
{ config , pkgs , ... } : {
programs.fish = {
enable = true ;
functions = {
fish_prompt = ''
# get status to set colour later
set -f s $status
# nix shell component
set pkgs (echo $PATH | tr ' ' "\n" | grep '^/nix/store' \
| sed 's#^[^-]*-##;s#-[^-]*$##' | xargs)
if test -n "$pkgs"
set_color yellow
echo -n "nix: $pkgs "
end
# ssh component
if test -n "$SSH_CLIENT$SSH_TTY$SSH_CONNECTION"
set_color blue
echo -n (whoami)@(hostname)' '
end
# pwd
test $s -eq 0 && set_color magenta || set_color red
echo -n (prompt_pwd)
# git component
set_color green
set branch (git branch 2> /dev/null | grep '^*' \
| cut -d'*' -f 2)
set_color green
echo -n $branch
# prompt component
set_color brwhite
echo -n ' $ '
set_color normal
'' ;
fish_greeting = ''
source /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.fish
'' ;
mkcd = "mkdir -p $argv && cd $argv" ;
xv = "touch $argv && chmod +x $argv && hx $argv" ;
clwy = ''
curl -s -X POST -H "Content-Type: text/plain" -d "$argv" \
'https://jerl.zone/contact' > /dev/null
'' ;
} ;
shellAbbrs = {
gs = "git status" ;
gc = "git commit" ;
gca = "git commit --amend" ;
ga = "git add" ;
gaa = "git add -A" ;
gse = "git send-email HEAD^ --to=\"\"" ;
gd = "git diff" ;
gP = "git push" ;
gp = "git pull" ;
gl = "git log '@{push}..'" ;
gla = "git log" ;
} ;
shellAliases = {
l = "ls -CB" ;
la = "ls -CAB" ;
ll = "ls -CBlh" ;
lla = "ls -CABlh" ;
cl = "clear" ;
"c." = "cd .." ;
":q" = "exit" ;
v = "hx" ;
sv = "sudo hx" ;
} ;
} ;
}

31
programs/helix.nix Normal file
View File

@ -0,0 +1,31 @@
{config, lib, pkgs, inputs, ...} : {
programs.helix = {
enable = true ;
defaultEditor = true ;
settings = {
theme = "horizon-dark" ;
editor = {
scrolloff = 4 ;
auto-format = true ;
auto-pairs = false ;
color-modes = true ;
lsp.snippets = true ;
cursor-shape.insert = "bar" ;
shell = [ "fish" "-c" ] ;
idle-timeout = 250 ;
whitespace = {
render.tab = "all" ;
characters.tab = "" ;
} ;
soft-wrap = {
enable = true ;
wrap-at-text-width = true ;
} ;
} ;
keys = {
normal = {
} ;
} ;
} ;
};
}

View File

@ -1,4 +1,4 @@
{ pkgs, lib, config, specialArgs, options, modulesPath }: { pkgs, lib, config, specialArgs, options, modulesPath, ... }:
with pkgs; with pkgs;
with pkgs.kakouneUtils; with pkgs.kakouneUtils;
@ -221,5 +221,5 @@ let
}; };
in in
{ {
environment.systemPackages = [ myKakoune kak-wrap ]; home.packages = [ myKakoune kak-wrap ];
} }

View File

@ -1,4 +1,4 @@
{ pkgs, lib, config, specialArgs, options, modulesPath }: { pkgs, lib, config, specialArgs, options, modulesPath, ... }:
with pkgs; with pkgs;
@ -230,5 +230,5 @@ let
in in
{ {
environment.systemPackages = [ pastebin ]; home.packages = [ pastebin ];
} }