Mac config

This commit is contained in:
Steph 2024-10-29 08:12:05 +01:00
parent 003c1d71f8
commit c22ed6af62
12 changed files with 389 additions and 195 deletions

57
flake.lock generated
View File

@ -26,11 +26,11 @@
"firefox-gnome-theme": {
"flake": false,
"locked": {
"lastModified": 1723137499,
"narHash": "sha256-MOE9NeU2i6Ws1GhGmppMnjOHkNLl2MQMJmGhaMzdoJM=",
"lastModified": 1728654484,
"narHash": "sha256-J53bks/1loTdXiSQz1OlOAc8jx9g399oF1YiXAX2JKQ=",
"owner": "rafaelmardojai",
"repo": "firefox-gnome-theme",
"rev": "fb5b578a4f49ae8705e5fea0419242ed1b8dba70",
"rev": "e53b84d428e7f5ba0f04d6a91e6cc6c05c75b632",
"type": "github"
},
"original": {
@ -39,6 +39,22 @@
"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": {
"locked": {
"lastModified": 1629284811,
@ -75,7 +91,38 @@
"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": {
"locked": {
"lastModified": 1718149104,
"narHash": "sha256-Ds1QpobBX2yoUDx9ZruqVGJ/uQPgcXoYuobBguyKEh8=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "e913ae340076bbb73d9f4d3d065c2bca7caafb16",
"type": "github"
},
"original": {
"id": "nixpkgs",
"type": "indirect"
}
},
"nixpkgs_2": {
"locked": {
"lastModified": 1727540905,
"narHash": "sha256-40J9tW7Y794J7Uw4GwcAKlMxlX2xISBl6IBigo83ih8=",
@ -110,8 +157,10 @@
"inputs": {
"firefox-addons": "firefox-addons",
"firefox-gnome-theme": "firefox-gnome-theme",
"firefox-macos-theme": "firefox-macos-theme",
"home": "home",
"nixpkgs": "nixpkgs",
"nix-darwin": "nix-darwin",
"nixpkgs": "nixpkgs_2",
"nur": "nur"
}
}

View File

@ -8,25 +8,26 @@
home.inputs.nixpkgs.follows = "nixpkgs";
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"; };
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 {
system = "x86_64-linux";
modules = [
home.nixosModules.home-manager
{
imports = [
./configuration.nix
./nixos.nix
./hardware-configuration/iota.nix
{_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 ; };
home-manager.extraSpecialArgs = { inherit inputs ; os = "linux"; };
}
];
};
@ -36,16 +37,21 @@
home.nixosModules.home-manager
{
imports = [
./configuration.nix
./nixos.nix
./hardware-configuration/tau.nix
{_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 ; };
home-manager.extraSpecialArgs = { inherit inputs ; os = "linux"; };
}
];
};
homeConfigurations.stephans = home.lib.homeManagerConfiguration rec {
pkgs = nixpkgs.legacyPackages."aarch64-darwin";
extraSpecialArgs = { inherit inputs ; os = "darwin"; };
modules = [ ./home.nix ./platforms/darwin/home.nix ];
};
};
}

122
home.nix
View File

@ -1,125 +1,57 @@
{config, lib, pkgs, inputs, ...}: {
{config, lib, pkgs, inputs, os, ...}: {
imports = [
./programs/firefox.nix
./programs/tmux.nix
./programs/bash.nix
./programs/kakoune.nix
./programs/pastebin.nix
./programs/helix.nix
./programs/firefox.nix
];
options = {};
config = {
home.stateVersion = "22.05";
programs.home-manager.enable = true;
nixpkgs = {
config.allowUnfree = true;
overlays = [ inputs.nur.overlay ];
};
home.packages = with pkgs; [
bat
bottom
dino
direnv
element-desktop
endeavour
btop
entr
eza
fd
file
foliate
fortune
fragments
git
gparted
htop
inkscape
lf
libreoffice
minetest
mpv
mumble
neovim
nextcloud-client
nix-direnv
nodejs-18_x
obs-studio
openvpn
pinta
prismlauncher
pandoc
ripgrep
sequeler
skim
sqlite
sqlite.dev
stack
steam-run
syncplay
tdesktop
thunderbird
tmux
tuba
ungoogled-chromium
texliveFull
unzip
vim
vscodium
wget
widevine-cdm
wl-clipboard
zip
zotero
thunderbird
signal-desktop
entr
pandoc
texliveFull
];
coreutils
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"
# fonts
(nerdfonts.override { fonts = [ "FiraCode" "DroidSansMono" ]; })
noto-fonts
noto-fonts-cjk
noto-fonts-emoji
inter
google-fonts
vistafonts
];
};
"org/gnome/desktop/background" = {
"picture-uri" = "${config.home.homeDirectory}/.background-image";
};
};
home.file.".background-image".source = "${./.}/Morskie Oko.jpg";
}

View File

@ -3,8 +3,7 @@
{
imports =
[
./programs/kakoune.nix
./programs/pastebin.nix
];
nix = {
@ -14,9 +13,7 @@
'';
};
nixpkgs.overlays = [
inputs.nur.overlay
];
networking.networkmanager.enable = true;
@ -79,37 +76,16 @@
description = "Steph";
extraGroups = [ "networkmanager" "wheel" "dialout" "podman" "docker" ];
packages = with pkgs; [
# Use home-manager doofus
];
};
networking.firewall.allowedTCPPorts = [ 8080 ];
networking.extraHosts = ''
86.95.92.180 apprise.prod.gaiaplant.app
192.145.59.184 marshallingyard.steph.tools
'';
services.avahi.enable = false;
virtualisation.podman.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.systemPackages = with pkgs; [
podman
docker-compose
fprintd
libfprint-2-tod1-vfs0090
udev

View File

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

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

@ -0,0 +1,90 @@
{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"
"im.dino.Dino.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.bashrcExtra = ''
if [ -n "$PS1" ]; then
@ -25,8 +25,6 @@ $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\] \$ "
fi
eval "$(direnv hook bash)"
'';
programs.bash.shellAliases = {
chmod = "chmod --preserve-root";
@ -36,10 +34,13 @@ $NEW_PROMPT_COMMAND"
free = "free -h";
toupper = "tr [:lower:] [:upper:]";
tolower = "tr [:upper:] [:lower:]";
rebuild = ''
nixos-rebuild switch --flake "$HOME/.local/os#" --use-remote-sudo
rebuild = if (os == "linux") then ''
nixos-rebuild switch --flake "path:$HOME/.local/os#" --use-remote-sudo
'' else ''
home-manager switch
'';
":r" = "!!";
":wq" = "exit";
};
programs.bash.sessionVariables = {
NIX_SHELL_PRESERVE_PROMPT = 1;

View File

@ -1,12 +1,33 @@
{config, lib, pkgs, inputs, ...} : {
home.file.".mozilla/firefox/default/chrome/firefox-gnome-theme".source = inputs.firefox-gnome-theme;
programs.firefox.enable = true;
programs.firefox.profiles.default = {
userChrome = ''
@import "firefox-gnome-theme/userChrome.css";
{config, lib, pkgs, inputs, os, ...} : lib.mkMerge [
(lib.mkIf (os == "linux") {
home.file.".mozilla/firefox/default/chrome/theme".source =
inputs.firefox-gnome-theme;
})
(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";
'';
userContent = ''
@import "firefox-gnome-theme/userContent.css";
userContent = if (os == "linux") then ''
@import "theme/userContent.css";
'' else ''
@import "theme/chrome/userContent.css";
'';
settings = {
"toolkit.legacyUserProfileCustomizations.stylesheets" = true; # Enable customChrome.cs
@ -23,13 +44,16 @@
ublock-origin
bitwarden
consent-o-matic
sponsorblock
multi-account-containers
] ++ (if (os == "darwin") then [
onepassword-password-manager
] else [
wayback-machine
h264ify
sponsorblock
fediact
multi-account-containers
tampermonkey
];
]);
search = {
default = "DuckDuckGo";
force = true;
@ -44,3 +68,6 @@
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.kakouneUtils;
@ -221,5 +221,5 @@ let
};
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;
@ -230,5 +230,5 @@ let
in
{
environment.systemPackages = [ pastebin ];
home.packages = [ pastebin ];
}