Merge remote-tracking branch 'origin/nixos' into nixos

This commit is contained in:
Moritz Böhme 2023-08-26 13:06:02 +02:00
commit d6d2897eb6
No known key found for this signature in database
GPG key ID: 970C6E89EB0547A9
55 changed files with 1281 additions and 1052 deletions

View file

@ -6,14 +6,70 @@
with lib;
let
nom-system = pkgs.writeShellApplication {
nom-system = pkgs.writeFishApplication {
name = "nom-system";
runtimeInputs = with pkgs; [ nix-output-monitor ];
text = ''
nom build --no-link "/home/moritz/.dotfiles#nixosConfigurations.$(hostname).config.system.build.toplevel"
text = /* fish */ ''
nom build --no-link "/home/moritz/.dotfiles#nixosConfigurations.$(hostname).config.system.build.toplevel" $argv
'';
};
nom-system-command = command: "${nom-system}/bin/nom-system && ${command}";
nom-system-command = name: command: pkgs.writeFishApplication {
inherit name;
runtimeInputs = with pkgs; [ nom-system nix ];
text = /* fish */ ''
nom-system $argv && ${command}
'';
};
f = pkgs.writeFishApplication {
name = "f";
runtimeInputs = with pkgs; [ fzf bat ];
text = /* fish */ ''
fzf --query "$argv" \
--multi \
--bind "enter:become($EDITOR {+})" \
--preview "bat --color=always --style=header,grid --line-range :500 {+}"
'';
};
which-nix = pkgs.writeFishApplication {
name = "which-nix";
runtimeInputs = with pkgs; [ which coreutils-full ];
text = /* fish */ ''
readlink -f (which $argv)
'';
completions = /* fish */ ''
complete -c which-nix -fa '(__fish_complete_command)'
'';
};
gi = pkgs.writeFishApplication
{
name = "gi";
runtimeInputs = with pkgs; [ fzf gum curl ];
text = /* fish */ ''
set url https://www.gitignore.io/api
if test (count $argv) -eq 0
set choice ( curl -sL $url/list \
| string split "," \
| fzf -m \
| string join "," )
else
set choice (string join "," $argv[1..])
end
if gum confirm "Overwrite current .gitignore?"
curl -sL $url/$choice > .gitignore
else
curl -sL $url/$choice >> .gitignore
end
'';
completions = /* fish */ ''
set args (curl -sL https://www.gitignore.io/api/list | string split ",")
complete -c gi -fa "$args"
'';
};
in
{
users.users.moritz = {
@ -43,12 +99,8 @@ in
cat = "bat";
rm = "rm -i";
mv = "mv -i";
cd = "z";
cd = "__zoxide_z";
f = "fzf --multi --bind \"enter:become($EDITOR {+})\"";
nixos-switch = nom-system-command "sudo nixos-rebuild switch --flake ~/.dotfiles";
nixos-boot = nom-system-command "sudo nixos-rebuild boot --flake ~/.dotfiles";
nixos-update = "pushd ~/.dotfiles && nix flake update && popd";
latexwatch = ''find -type f -name "*.tex" | entr -c latexmk -pdf -silent'';
@ -60,7 +112,6 @@ in
fish.enable = true;
git.enable = true;
gpg.enable = true;
navi.enable = true;
nix = {
gc.enable = true;
optimise.enable = true;
@ -96,12 +147,15 @@ in
bottom
# nix
(nom-system-command "nixos-boot" "sudo nixos-rebuild boot --flake ~/.dotfiles")
(nom-system-command "nixos-switch" "sudo nixos-rebuild switch --flake ~/.dotfiles")
comma
manix
nix-index
nix-output-monitor
nixpkgs-fmt
statix
manix
nix-output-monitor
which-nix
# other
bat
@ -110,17 +164,19 @@ in
duf
entr
exa
f
gi
gparted
neofetch
reptyr
ripgrep
up
vim
viu
wget
vim
];
fonts.fonts = with pkgs; [
fonts.packages = with pkgs; [
(nerdfonts.override {
fonts = [ "FiraCode" ];
})
@ -154,9 +210,15 @@ in
enable = true;
defaultOptions = [
"--height 50%"
"--bind alt-j:preview-down,alt-k:preview-up"
];
};
zoxide = {
enable = true;
options = [
"--cmd c"
];
};
zoxide.enable = true;
};
home = {
username = "moritz";

View file

@ -36,7 +36,25 @@ in
nix-edit.enable = mkDefault true;
nvim.enable = mkDefault true;
python.versions."311".enable = mkDefault true;
spotify.enable = mkDefault true;
spotify-player = {
enable = mkDefault true;
package = pkgs.spotify-player.overrideAttrs (old: {
buildFeatures = lib.lists.remove "notify" (old.buildFeatures or [ ]);
});
config = {
client_id = "3172dbeaf64949728920c58b823bc24b";
copy_command = {
command = "wl-copy";
args = [ ];
};
enable_cover_image_cache = true;
default_device = "spotify-player-daemon";
enable_streaming = false;
playback_window_position = "Bottom";
cover_img_length = 20;
cover_img_width = 10;
};
};
ssh.enable = mkDefault true;
thunar.enable = mkDefault true;
wallpaper.enable = mkDefault true;
@ -47,6 +65,20 @@ in
gammastep.enable = true;
kdeconnect.enable = mkDefault true;
printing.enable = true;
spotify-player = {
enable = mkDefault true;
config = {
client_id = "3172dbeaf64949728920c58b823bc24b";
device = {
name = "spotify-player-daemon";
device_type = "computer";
volume = 70;
bitrate = 320;
audio_cache = true;
};
};
};
timers.enable = true;
wireguard.enable = true;
};
};
@ -75,6 +107,7 @@ in
};
services = {
illum.enable = true;
resolved.enable = true;
gnome.gnome-keyring.enable = true;
pipewire = {
enable = true;