legacy artemis config - needs refactor

This commit is contained in:
Callum Leslie 2024-08-30 17:08:21 +01:00
parent aba3aceed8
commit 961d41b9bf
Signed by: cleslie
GPG key ID: D382C4AFEECEAA90
34 changed files with 1572 additions and 12 deletions

281
flake.lock generated
View file

@ -23,6 +23,120 @@
"type": "github" "type": "github"
} }
}, },
"base16": {
"inputs": {
"fromYaml": "fromYaml"
},
"locked": {
"lastModified": 1708890466,
"narHash": "sha256-LlrC09LoPi8OPYOGPXegD72v+//VapgAqhbOFS3i8sc=",
"owner": "SenchoPens",
"repo": "base16.nix",
"rev": "665b3c6748534eb766c777298721cece9453fdae",
"type": "github"
},
"original": {
"owner": "SenchoPens",
"repo": "base16.nix",
"type": "github"
}
},
"base16-fish": {
"flake": false,
"locked": {
"lastModified": 1622559957,
"narHash": "sha256-PebymhVYbL8trDVVXxCvZgc0S5VxI7I1Hv4RMSquTpA=",
"owner": "tomyun",
"repo": "base16-fish",
"rev": "2f6dd973a9075dabccd26f1cded09508180bf5fe",
"type": "github"
},
"original": {
"owner": "tomyun",
"repo": "base16-fish",
"type": "github"
}
},
"base16-foot": {
"flake": false,
"locked": {
"lastModified": 1696725948,
"narHash": "sha256-65bz2bUL/yzZ1c8/GQASnoiGwaF8DczlxJtzik1c0AU=",
"owner": "tinted-theming",
"repo": "base16-foot",
"rev": "eedbcfa30de0a4baa03e99f5e3ceb5535c2755ce",
"type": "github"
},
"original": {
"owner": "tinted-theming",
"repo": "base16-foot",
"type": "github"
}
},
"base16-helix": {
"flake": false,
"locked": {
"lastModified": 1720809814,
"narHash": "sha256-numb3xigRGnr/deF7wdjBwVg7fpbTH7reFDkJ75AJkY=",
"owner": "tinted-theming",
"repo": "base16-helix",
"rev": "34f41987bec14c0f3f6b2155c19787b1f6489625",
"type": "github"
},
"original": {
"owner": "tinted-theming",
"repo": "base16-helix",
"type": "github"
}
},
"base16-kitty": {
"flake": false,
"locked": {
"lastModified": 1665001328,
"narHash": "sha256-aRaizTYPpuWEcvoYE9U+YRX+Wsc8+iG0guQJbvxEdJY=",
"owner": "kdrag0n",
"repo": "base16-kitty",
"rev": "06bb401fa9a0ffb84365905ffbb959ae5bf40805",
"type": "github"
},
"original": {
"owner": "kdrag0n",
"repo": "base16-kitty",
"type": "github"
}
},
"base16-tmux": {
"flake": false,
"locked": {
"lastModified": 1696725902,
"narHash": "sha256-wDPg5elZPcQpu7Df0lI5O8Jv4A3T6jUQIVg63KDU+3Q=",
"owner": "tinted-theming",
"repo": "base16-tmux",
"rev": "c02050bebb60dbb20cb433cd4d8ce668ecc11ba7",
"type": "github"
},
"original": {
"owner": "tinted-theming",
"repo": "base16-tmux",
"type": "github"
}
},
"base16-vim": {
"flake": false,
"locked": {
"lastModified": 1716150083,
"narHash": "sha256-ZMhnNmw34ogE5rJZrjRv5MtG3WaqKd60ds2VXvT6hEc=",
"owner": "tinted-theming",
"repo": "base16-vim",
"rev": "6e955d704d046b0dc3e5c2d68a2a6eeffd2b5d3d",
"type": "github"
},
"original": {
"owner": "tinted-theming",
"repo": "base16-vim",
"type": "github"
}
},
"devour-flake": { "devour-flake": {
"flake": false, "flake": false,
"locked": { "locked": {
@ -81,6 +195,29 @@
"type": "github" "type": "github"
} }
}, },
"firefox-addons": {
"inputs": {
"flake-utils": "flake-utils",
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"dir": "pkgs/firefox-addons",
"lastModified": 1725014336,
"narHash": "sha256-4sLMoyIIRR2eRNCcQN1N7UEtuETpa0KrnJOe3vKJm3I=",
"owner": "rycee",
"repo": "nur-expressions",
"rev": "c4261180db65409bd3a71bd300c97313d5d37051",
"type": "gitlab"
},
"original": {
"dir": "pkgs/firefox-addons",
"owner": "rycee",
"repo": "nur-expressions",
"type": "gitlab"
}
},
"flake-compat": { "flake-compat": {
"flake": false, "flake": false,
"locked": { "locked": {
@ -127,6 +264,22 @@
"url": "https://flakehub.com/f/edolstra/flake-compat/1.tar.gz" "url": "https://flakehub.com/f/edolstra/flake-compat/1.tar.gz"
} }
}, },
"flake-compat_4": {
"flake": false,
"locked": {
"lastModified": 1673956053,
"narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9",
"type": "github"
},
"original": {
"owner": "edolstra",
"repo": "flake-compat",
"type": "github"
}
},
"flake-parts": { "flake-parts": {
"inputs": { "inputs": {
"nixpkgs-lib": "nixpkgs-lib" "nixpkgs-lib": "nixpkgs-lib"
@ -190,6 +343,21 @@
} }
}, },
"flake-utils": { "flake-utils": {
"locked": {
"lastModified": 1629284811,
"narHash": "sha256-JHgasjPR0/J1J3DRm4KxM4zTyAj4IOJY8vIl75v/kPI=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "c5d161cc0af116a2e17f54316f0bf43f0819785c",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"flake-utils_2": {
"inputs": { "inputs": {
"systems": "systems_2" "systems": "systems_2"
}, },
@ -207,9 +375,30 @@
"type": "github" "type": "github"
} }
}, },
"flake-utils_2": { "flake-utils_3": {
"inputs": { "inputs": {
"systems": "systems_3" "systems": [
"stylix",
"systems"
]
},
"locked": {
"lastModified": 1710146030,
"narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"flake-utils_4": {
"inputs": {
"systems": "systems_4"
}, },
"locked": { "locked": {
"lastModified": 1694529238, "lastModified": 1694529238,
@ -225,6 +414,22 @@
"type": "github" "type": "github"
} }
}, },
"fromYaml": {
"flake": false,
"locked": {
"lastModified": 1689549921,
"narHash": "sha256-iX0pk/uB019TdBGlaJEWvBCfydT6sRq+eDcGPifVsCM=",
"owner": "SenchoPens",
"repo": "fromYaml",
"rev": "11fbbbfb32e3289d3c631e0134a23854e7865c84",
"type": "github"
},
"original": {
"owner": "SenchoPens",
"repo": "fromYaml",
"type": "github"
}
},
"git-hooks": { "git-hooks": {
"inputs": { "inputs": {
"flake-compat": "flake-compat_2", "flake-compat": "flake-compat_2",
@ -333,6 +538,23 @@
"type": "github" "type": "github"
} }
}, },
"gnome-shell": {
"flake": false,
"locked": {
"lastModified": 1713702291,
"narHash": "sha256-zYP1ehjtcV8fo+c+JFfkAqktZ384Y+y779fzmR9lQAU=",
"owner": "GNOME",
"repo": "gnome-shell",
"rev": "0d0aadf013f78a7f7f1dc984d0d812971864b934",
"type": "github"
},
"original": {
"owner": "GNOME",
"ref": "46.1",
"repo": "gnome-shell",
"type": "github"
}
},
"hercules-ci-effects": { "hercules-ci-effects": {
"inputs": { "inputs": {
"flake-parts": "flake-parts_3", "flake-parts": "flake-parts_3",
@ -617,7 +839,7 @@
}, },
"nuschtosSearch": { "nuschtosSearch": {
"inputs": { "inputs": {
"flake-utils": "flake-utils", "flake-utils": "flake-utils_2",
"nixpkgs": [ "nixpkgs": [
"nixvim", "nixvim",
"nixvim", "nixvim",
@ -643,15 +865,51 @@
"agenix": "agenix", "agenix": "agenix",
"devour-flake": "devour-flake", "devour-flake": "devour-flake",
"disko": "disko", "disko": "disko",
"firefox-addons": "firefox-addons",
"home-manager": "home-manager_2", "home-manager": "home-manager_2",
"nixinate": "nixinate", "nixinate": "nixinate",
"nixpkgs": "nixpkgs", "nixpkgs": "nixpkgs",
"nixvim": "nixvim", "nixvim": "nixvim",
"nur": "nur", "nur": "nur",
"stylix": "stylix",
"unstable": "unstable", "unstable": "unstable",
"utils": "utils" "utils": "utils"
} }
}, },
"stylix": {
"inputs": {
"base16": "base16",
"base16-fish": "base16-fish",
"base16-foot": "base16-foot",
"base16-helix": "base16-helix",
"base16-kitty": "base16-kitty",
"base16-tmux": "base16-tmux",
"base16-vim": "base16-vim",
"flake-compat": "flake-compat_4",
"flake-utils": "flake-utils_3",
"gnome-shell": "gnome-shell",
"home-manager": [
"home-manager"
],
"nixpkgs": [
"unstable"
],
"systems": "systems_3"
},
"locked": {
"lastModified": 1724702977,
"narHash": "sha256-bP1/BHbEigLjTTmqyy1t8w5EVWHuLuABtOd/BBXVLtA=",
"owner": "danth",
"repo": "stylix",
"rev": "6c895c6b42ca205017abe72a7263baf36a197972",
"type": "github"
},
"original": {
"owner": "danth",
"repo": "stylix",
"type": "github"
}
},
"systems": { "systems": {
"locked": { "locked": {
"lastModified": 1681028828, "lastModified": 1681028828,
@ -697,6 +955,21 @@
"type": "github" "type": "github"
} }
}, },
"systems_4": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"treefmt-nix": { "treefmt-nix": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
@ -737,7 +1010,7 @@
}, },
"utils": { "utils": {
"inputs": { "inputs": {
"flake-utils": "flake-utils_2" "flake-utils": "flake-utils_4"
}, },
"locked": { "locked": {
"lastModified": 1722363685, "lastModified": 1722363685,

View file

@ -35,6 +35,11 @@
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
stylix = {
url = "github:danth/stylix";
inputs.nixpkgs.follows = "unstable";
inputs.home-manager.follows = "home-manager";
};
#omnix-flake.url = "github:juspay/omnix?dir=nix/om"; #omnix-flake.url = "github:juspay/omnix?dir=nix/om";
disko = { disko = {
@ -42,6 +47,11 @@
inputs.nixpkgs.follows = "nixpkgs"; 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";
}; };
@ -91,7 +101,7 @@
nur.overlay nur.overlay
]; ];
hostDefaults.modules = [home-manager.nixosModules.home-manager inputs.agenix.nixosModules.default] ++ mods.sharedModules; hostDefaults.modules = [home-manager.nixosModules.home-manager inputs.stylix.nixosModules.stylix inputs.agenix.nixosModules.default] ++ mods.sharedModules;
hostDefaults.extraArgs = { hostDefaults.extraArgs = {
inherit inputs; inherit inputs;

54
home/default.nix Normal file
View file

@ -0,0 +1,54 @@
{
inputs,
config,
pkgs,
...
}: {
imports = [./programs ./services];
programs.home-manager.enable = true;
home = {
username = "c";
homeDirectory = "/home/c";
};
home.packages = with pkgs; [
libsecret
bitwarden
betterbird
wl-clipboard
(discord.override {
withOpenASAR = true;
})
brightnessctl
playerctl
pwvucontrol
tldr
grc
fd
rofi-rbw-wayland
wtype
mullvad-vpn
spotify
gnumake
delta
slurp
grim
clang-tools
clang
ghq
gst
udiskie
rustup
ripgrep
zig
ghc
xh
unzip
just
inputs.nixvim.packages."x86_64-linux".default # nixvim
];
home.stateVersion = "24.05";
}

View file

@ -0,0 +1,13 @@
{
config,
inputs,
pkgs,
...
}: {
programs.alacritty = {
enable = true;
settings = {
env = {TERM = "xterm-256color";};
};
};
}

24
home/programs/default.nix Normal file
View file

@ -0,0 +1,24 @@
{
inputs,
config,
pkgs,
...
}: {
imports = [
./hypr
./waybar
./git
./fish
./rofi
./rbw
./firefox
./tmux
./alacritty
./direnv
];
programs = {
gpg.enable = true;
wpaperd.enable = true;
};
}

View file

@ -0,0 +1,14 @@
{
config,
inputs,
pkgs,
...
}: {
programs.direnv = {
enable = true;
nix-direnv.enable = true;
config.global = {
hide_env_diff = true;
};
};
}

View file

@ -0,0 +1,60 @@
{
config,
inputs,
pkgs,
...
}: {
programs.firefox = {
enable = true;
policies = {
DisablePocket = true;
DisableTelemetry = true;
};
profiles.c = {
bookmarks = [
{
name = "NixOS";
toolbar = true;
bookmarks = [
{
name = "Packages";
url = "https://search.nixos.org";
}
{
name = "Wiki";
url = "https://nixos.wiki";
}
];
}
{
name = "News";
toolbar = true;
bookmarks = [
{
name = "Al Jazeera";
url = "https://aljazeera.com";
}
];
}
];
containers = {};
settings = {};
userChrome = "";
userContent = "";
extensions = with inputs.firefox-addons.packages."x86_64-linux"; [
bitwarden
ublock-origin
darkreader
youtube-shorts-block
privacy-badger
return-youtube-dislikes
];
};
};
}

View file

@ -0,0 +1,58 @@
{
config,
inputs,
pkgs,
...
}: {
programs.fish = {
enable = true;
interactiveShellInit = ''
set fish_greeting
trap __trap_exit_tmux EXIT
'';
shellAliases = {v = "nvim";};
functions = {
__trap_exit_tmux = {
body = ''
test (tmux list-windows | wc -l) = 1 || exit
test (tmux list-panes | wc -l) = 1 || exit
tmux switch-client -t main
'';
};
};
plugins = with pkgs.fishPlugins; [
{
name = "z";
inherit (z) src;
}
{
name = "hydro";
inherit (hydro) src;
}
{
name = "sponge";
inherit (sponge) src;
}
{
name = "grc";
inherit (grc) src;
}
{
name = "done";
inherit (done) src;
}
{
name = "fzf-fish";
inherit (fzf-fish) src;
}
{
name = "forgit";
inherit (forgit) src;
}
];
};
}

View file

@ -0,0 +1,44 @@
{
config,
inputs,
pkgs,
...
}: {
programs.git = {
enable = true;
userName = "Callum Leslie";
userEmail = "git@cleslie.uk";
signing.key = "D382C4AFEECEAA90";
signing.signByDefault = true;
ignores = [".direnv/"];
includes = [
{
condition = "gitdir:~/repos/projects.cs.nott.ac.uk/";
contents = {
user = {
email = "psycl6@nottingham.ac.uk";
signingKey = "5A944DF89B6F65AC";
};
credential = {helper = "store";};
};
}
];
extraConfig = {
core = {
longpaths = true;
autocrlf = false;
};
init = {defaultBranch = "main";};
push = {autoSetupRemote = true;};
ghq = {root = "~/repos";};
};
diff-so-fancy.enable = true;
};
}

View file

@ -0,0 +1,167 @@
{
config,
inputs,
pkgs,
...
}: {
wayland.windowManager.hyprland = {
enable = true;
systemd.enable = true;
xwayland.enable = true;
# TODO: move to nix config over text
settings = {
"monitor" = ",prefered,auto,1";
general = {
gaps_in = 0;
gaps_out = 0;
border_size = 1;
};
decoration = {
drop_shadow = true;
shadow_range = 4;
shadow_render_power = 3;
};
animations = {
enabled = true;
bezier = "myBezier, 0.05, 0.9, 0.1, 1.05";
animation = [
"windows, 1, 1, default, popin"
"fade, 1, 7, default"
"workspaces, 1, 1, default, fade"
];
};
dwindle = {
pseudotile = true;
preserve_split = true;
no_gaps_when_only = 1;
};
master = {
no_gaps_when_only = 1;
};
gestures.workspace_swipe = false;
misc = {
enable_swallow = true;
swallow_regex = "Alacritty";
disable_hyprland_logo = true;
disable_splash_rendering = true;
};
input = {
kb_layout = "gb,us";
kb_variant = ",workman";
kb_model = "";
kb_options = "ctrl:nocaps, grp:alt_shift_toggle";
kb_rules = "";
follow_mouse = true;
touchpad = {
natural_scroll = true;
scroll_factor = 0.3;
};
sensitivity = 0.5;
accel_profile = "flat";
scroll_method = "2fg";
};
"$mainMod" = "SUPER";
bind =
[
"$mainMod, q, killactive"
"$mainMod SHIFT, q, exit"
"$mainMod, F, fullscreen"
"$mainMod SHIFT, f, togglefloating"
"$mainMod, d, exec, rofi -show drun"
"$mainMod, w, exec, rofi -show window"
"$mainMod, p, exec, rofi-rbw --no-folder"
"$mainMod, s, togglesplit"
"$mainMod SHIFT, r, exec, hyprctl reload"
"$mainMod, return, exec, alacritty -e tmux new -A -s main"
"$mainMod SHIFT, return, exec, [float; pin] alacritty -e tmux new -A -s main"
"$mainMod, b, workspace, name:web"
"$mainMod, n, workspace, name:chat"
"$mainMod, m, workspace, name:media"
"$mainMod, v, workspace, name:mail"
"$mainMod SHIFT, b, movetoworkspace, name:web"
"$mainMod SHIFT, n, movetoworkspace, name:chat"
"$mainMod SHIFT, m, movetoworkspace, name:media"
"$mainMod SHIFT, v, movetoworkspace, name:mail"
"$mainMod CTRL, b, moveworkspacetomonitor, name:web current"
"$mainMod CTRL, n, moveworkspacetomonitor, name:chat current"
"$mainMod CTRL, m, moveworkspacetomonitor, name:media current"
"$mainMod CTRL, v, moveworkspacetomonitor, name:mail current"
"$mainMod CTRL, b, workspace, name:web"
"$mainMod CTRL, n, workspace, name:chat"
"$mainMod CTRL, m, workspace, name:media"
"$mainMod CTRL, v, workspace, name:mail"
"$mainMod, h, movefocus, l"
"$mainMod, l, movefocus, r"
"$mainMod, k, movefocus, u"
"$mainMod, j, movefocus, d"
"$mainMod SHIFT, h, movewindow, l"
"$mainMod SHIFT, l, movewindow, r"
"$mainMod SHIFT, k, movewindow, u"
"$mainMod SHIFT, j, movewindow, d"
''SHIFT, Print, exec, grim -g "$(slurp)" - | wl-copy''
", Print, exec, grim - | wl-copy"
]
++ (builtins.concatLists (builtins.genList (x: let
ws = let c = (x + 1) / 10; in builtins.toString (x + 1 - (c * 10));
in [
"$mainMod, ${ws}, workspace, ${toString (x + 1)}"
"$mainMod SHIFT, ${ws}, movetoworkspace, ${toString (x + 1)}"
"$mainMod CTRL, ${ws}, moveworkspacetomonitor, ${
toString (x + 1)
} current"
"$mainMod CTRL, ${ws}, workspace, ${toString (x + 1)}"
])
10));
workspace = [
"name:web, on-created-empty: firefox"
"name:chat, on-created-empty: discord"
"name:media, on-created-empty: spotify"
"name:mail, on-created-empty: betterbird"
];
bindm = [
"$mainMod, mouse:272, movewindow"
"$mainMod, mouse:273, resizewindow"
];
bindle = [
", XF86AudioRaiseVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+"
", XF86AudioLowerVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-"
", XF86AudioMute , exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle"
", XF86AudioMicMute , exec, wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle"
", XF86AudioPlay , exec, playerctl play-pause"
", XF86AudioPause , exec, playerctl play-pause"
", XF86AudioNext , exec, playerctl next"
", XF86AudioPrev , exec, playerctl previous"
", XF86MonBrightnessUp, exec, brightnessctl -c backlight set +5%"
", XF86MonBrightnessDown, exec, brightnessctl -c backlight set 5%-"
];
exec = [
"pkill wpaperd & sleep 0.5 && wpaperd"
"pkill waybar & sleep 0.5 && waybar"
"pkill mako & sleep 0.5 && mako"
];
exec-once = ["blueman-tray" "mullvad-gui" "udiskie -t"];
};
};
}

View file

@ -0,0 +1,6 @@
{
"diagnostics.globals": [
"vim",
"lsp_on_attach"
]
}

View file

@ -0,0 +1,314 @@
{
config,
inputs,
pkgs,
lib,
...
}: {
programs.neovim = let
leaders = ''
vim.g.mapleader = ' '
vim.g.maplocalleader = ' '
'';
toLua = str: ''
lua << EOF
${leaders}
${str}
EOF
'';
toLuaFile = file: ''
lua << EOF
${leaders}
${builtins.readFile file}
EOF
'';
toLuaFileLSP = file: ''
lua << EOF
${leaders}
${builtins.readFile ./plugin/lsp/lsp-keys.lua}
${builtins.readFile file}
EOF
'';
fromGit = ref: rev: repo:
pkgs.vimUtils.buildVimPlugin {
pname = "${lib.strings.sanitizeDerivationName repo}";
version = ref;
src = builtins.fetchGit {
url = "https://github.com/${repo}.git";
inherit ref;
inherit rev;
};
};
# always installs latest version
pluginGit = fromGit "HEAD";
in {
enable = true;
# package = pkgs.neovim-nightly;
extraPackages = with pkgs; [
# Rust
rust-analyzer
cargo
rustc
rustfmt
# YAML
yaml-language-server
# JSON
nodePackages.vscode-json-languageserver
# Go
gopls
# Typescript
nodePackages.typescript
nodePackages.typescript-language-server
# Javascript
eslint_d
# Python
nodePackages.pyright
black
# Util
ripgrep
fzf
# C-Family
clang-tools
# Shell
shellcheck
shfmt
# Lua
lua-language-server
selene
stylua
# Nix
rnix-lsp
nixfmt
statix
# LLM
ollama
# Haskell
haskellPackages.haskell-debug-adapter
haskellPackages.haskell-language-server
haskellPackages.fourmolu
ghc
# Docker
dockerfile-language-server-nodejs
docker-compose-language-service
];
defaultEditor = true;
viAlias = true;
vimAlias = true;
vimdiffAlias = true;
extraLuaConfig = ''
${builtins.readFile ./options.lua}
'';
plugins = with pkgs.vimPlugins; [
{
plugin = nvim-lspconfig;
config = toLuaFileLSP ./plugin/lsp/lsp.lua;
}
{
plugin = crates-nvim;
config = toLua "require('crates').setup()";
}
{
plugin = rustaceanvim;
config = toLuaFileLSP ./plugin/lsp/rust.lua;
}
{
plugin = haskell-tools-nvim;
config = toLuaFileLSP ./plugin/lsp/haskell.lua;
}
{
plugin = SchemaStore-nvim;
config = toLuaFileLSP ./plugin/lsp/schemastore.lua;
}
{
plugin = todo-comments-nvim;
config =
toLua
"require('todo-comments').setup(); vim.api.nvim_set_keymap('n', '<leader>vtd', ':TodoTelescope<CR>', { noremap = true });";
}
{
plugin = comment-nvim;
config = toLua "require('Comment').setup()";
}
{
plugin = onedark-nvim;
config = "colorscheme onedark";
}
neodev-nvim
{
plugin = nvim-cmp;
config = toLuaFile ./plugin/cmp.lua;
}
{
plugin = telescope-nvim;
config = toLuaFile ./plugin/telescope.lua;
}
{
plugin =
pluginGit "951b163e55ce7639eb320c450bde9283c4fe968b"
"laytan/cloak.nvim";
config = toLuaFile ./plugin/cloak.lua;
}
{
plugin =
pluginGit "41ad952c8269fa7aa3a4b8a5abb44541cb628313"
"David-Kunz/gen.nvim";
config = toLuaFile ./plugin/gen.lua;
}
{
plugin = nvim-dap;
config = toLuaFile ./plugin/debugger.lua;
}
{
plugin =
pluginGit "fd35a46f4b7c1b244249266bdcb2da3814f01724"
"xiyaowong/transparent.nvim";
config = toLua "require('transparent').setup{}";
}
nvim-dap-ui
telescope-dap-nvim
nvim-dap-virtual-text
telescope-fzf-native-nvim
cmp_luasnip
cmp-nvim-lsp
luasnip
friendly-snippets
{
plugin = hardtime-nvim;
config = toLua "require('hardtime').setup()";
}
{
plugin = nvim-surround;
config = toLua "require('nvim-surround').setup{}";
}
{
plugin = harpoon;
config = toLuaFile ./plugin/harpoon.lua;
}
{
plugin = lualine-nvim;
config =
toLua
"require('lualine').setup{options = {icons_enabled = true, theme = 'onedark', component_separators = '|', section_separators = ''}, sections = { lualine_a = { { 'buffers', } } }}";
}
{
plugin = nvim-autopairs;
config = toLua "require('nvim-autopairs').setup {}";
}
{
plugin = leap-nvim;
config = toLua "require('leap.user').add_default_mappings()";
}
{
plugin = none-ls-nvim;
config = toLuaFile ./plugin/lsp/none-ls.lua;
}
{
plugin = oil-nvim;
config = toLuaFile ./plugin/oil.lua;
}
{
plugin = zen-mode-nvim;
config = toLuaFile ./plugin/zen.lua;
}
twilight-nvim
nvim-web-devicons
{
plugin = undotree;
config =
toLua "vim.keymap.set('n', '<leader>u', vim.cmd.UndotreeToggle)";
}
{
plugin = gitsigns-nvim;
config = toLuaFile ./plugin/gitsigns.lua;
}
{
plugin = nvim-treesitter.withPlugins (p: [
p.tree-sitter-nix
p.tree-sitter-vim
p.tree-sitter-bash
p.tree-sitter-lua
p.tree-sitter-python
p.tree-sitter-rust
p.tree-sitter-json
p.tree-sitter-c
p.tree-sitter-comment
p.tree-sitter-javascript
p.tree-sitter-fish
p.tree-sitter-dockerfile
p.tree-sitter-cpp
p.tree-sitter-git_config
p.tree-sitter-git_rebase
p.tree-sitter-gitattributes
p.tree-sitter-gitcommit
p.tree-sitter-gitignore
p.tree-sitter-markdown
p.tree-sitter-markdown_inline
p.tree-sitter-make
p.tree-sitter-norg
p.tree-sitter-ssh_config
p.tree-sitter-typescript
p.tree-sitter-tsx
p.tree-sitter-haskell
p.tree-sitter-yaml
p.tree-sitter-zig
]);
config = toLuaFile ./plugin/treesitter.lua;
}
vim-nix
];
};
}

View file

@ -0,0 +1,15 @@
{
config,
inputs,
pkgs,
...
}: {
programs.rbw = {
enable = true;
settings = {
base_url = "https://vaultwarden.cleslie.uk";
email = "cal@callumleslie.me";
pinentry = pkgs.pinentry-gnome3;
};
};
}

View file

@ -0,0 +1,12 @@
{
config,
inputs,
pkgs,
...
}: {
programs.rofi = {
enable = true;
package = pkgs.rofi-wayland;
#theme = "Arc-Dark";
};
}

View file

@ -0,0 +1,71 @@
{
config,
inputs,
pkgs,
...
}: {
programs.tmux = {
enable = true;
shortcut = "x";
baseIndex = 0;
escapeTime = 0;
clock24 = true;
mouse = true;
plugins = with pkgs.tmuxPlugins; [
sensible
yank
{
plugin = onedark-theme;
extraConfig = "\n";
}
{
plugin = resurrect;
extraConfig = ''
set -g @resurrect-strategy-vim 'session'
set -g @resurrect-strategy-nvim 'session'
set -g @resurrect-capture-pane-contents 'on'
'';
}
{
plugin = continuum;
extraConfig = ''
set -g @continuum-restore 'on'
set -g @continuum-boot 'off'
set -g @continuum-save-interval '10'
'';
}
];
extraConfig = ''
set-option -g status-position top
set-option -g default-terminal "tmux-256color"
set-option -sa terminal-features ',xterm-256color:RGB'
set-window-option -g mode-keys vi
bind / split-window -h -c "#{pane_current_path}"
bind \\ split-window -v -c "#{pane_current_path}"
bind c new-window -c "#{pane_current_path}"
bind-key -r s run-shell "tmux display-popup -E 'tmux-sessionizer -s'"
bind-key -r f run-shell "tmux display-popup -E 'tmux-sessionizer -p'"
bind-key -r m run-shell "tmux switch-client -t main"
bind S choose-tree
bind -r k select-pane -U
bind -r j select-pane -D
bind -r h select-pane -L
bind -r l select-pane -R
'';
};
home.packages = [
(pkgs.writeShellApplication {
name = "tmux-sessionizer";
runtimeInputs = [pkgs.tmux pkgs.ghq];
text = ''
${builtins.readFile ./tmux-sessionizer.sh}
'';
})
];
}

View file

@ -0,0 +1,59 @@
#!/bin/env bash
pick_session() {
selected=$(ghq list -p | fzf || exit 0)
if [[ -z $selected ]]; then
exit 0
fi
selected_name=$(basename "$selected" | tr . _)
tmux_running=$(pgrep tmux)
if [[ -z $TMUX ]] && [[ -z $tmux_running ]]; then
tmux new-session -s "$selected_name" -c "$selected"
exit 0
fi
if ! tmux has-session -t="$selected_name" 2>/dev/null; then
tmux new-session -ds "$selected_name" -c "$selected"
fi
tmux switch-client -t "$selected_name"
}
switch_session() {
selected=$(tmux list-sessions -F "#{session_name}" | fzf || exit 0)
if [[ -z $selected ]]; then
exit 0
fi
tmux switch-client -t "$selected"
}
selections=()
while getopts "sp" opt; do
case ${opt} in
p) selections+=("pick") ;;
s) selections+=("switch") ;;
\?)
echo "Invalid usage"
exit
;;
esac
done 2>/dev/null
case ${#selections[@]} in
1) selection=${selections[0]} ;;
*)
echo "Please make exactly one selection (-p or -s)" >&2
exit 1
;;
esac
shift $((OPTIND - 1))
case $selection in
"pick") pick_session ;;
"switch") switch_session ;;
esac

View file

@ -0,0 +1,94 @@
{
config,
inputs,
pkgs,
...
}: {
programs.waybar = {
enable = true;
package = pkgs.waybar.override {
hyprlandSupport = true;
swaySupport = false;
};
systemd.enable = false;
settings = {
mainBar = {
layer = "top";
position = "bottom";
height = 20;
modules-left = ["hyprland/workspaces" "hyprland/submap"];
modules-center = ["hyprland/window"];
modules-right = ["temperature" "wireplumber" "backlight" "battery" "clock" "tray"];
clock = {
tooltip = false;
interval = 1;
format = "{:%H:%M}";
format-alt = "{:%d %B %Y, %A}";
};
battery = {
states = {
full = 99;
good = 98;
normal = 98;
warning = 20;
critical = 10;
};
format = "{icon} {capacity}%";
format-good = "{icon} {capacity}%";
format-full = " {capacity}%";
format-icons = ["" "" "" "" ""];
tooltip = false;
};
wireplumber = {
on-click = "${pkgs.pwvucontrol}/bin/pwvucontrol";
format = "{icon} {volume}%";
format-muted = "";
format-icons = ["" "" ""];
tooltip = false;
};
backlight = {
format = "{icon} {percent}%";
format-icons = ["" "" "" ""];
tooltip = false;
};
tray = {
icon-size = 18;
spacing = 4;
show-passive-items = true;
tooltip = false;
};
temperature = {
thermal-zone = 0;
format = "{icon} {temperatureC}°C";
format-icons = [""];
interval = 30;
tooltip = false;
};
};
};
style = ''
* {
min-height: 0;
border: none;
border-radius: 0;
margin: 0px;
font-size: 13px;
}
#workspaces button {
margin: 0px;
padding: 0 5px;
}
#workspaces button.focused, #workspaces button.active {
border-bottom: 3px solid @base05;
}
#workspaces button:hover {
background: alpha(@base05, 1);
color: @base00;
}
'';
};
}

16
home/services/default.nix Normal file
View file

@ -0,0 +1,16 @@
{
inputs,
config,
pkgs,
...
}: {
imports = [./mako];
services = {
network-manager-applet.enable = true;
mpris-proxy.enable = true;
gpg-agent = {
enable = true;
enableSshSupport = true;
};
};
}

View file

@ -0,0 +1,11 @@
{
config,
inputs,
pkgs,
...
}: {
services.mako = {
enable = true;
defaultTimeout = 7000;
};
}

View file

@ -0,0 +1,47 @@
{
pkgs,
inputs,
...
}: let
inherit (inputs.self.nixosModules) keys;
in {
services.remote-deploy = {
enable = false;
keys = keys.c;
};
time.timeZone = "Europe/London";
i18n.defaultLocale = "en_GB.UTF-8";
users.users.c = {
isNormalUser = true;
extraGroups = ["wheel" "networkmanager" "libvirtd" "dialout"];
openssh.authorizedKeys.keys = keys.c;
shell = pkgs.fish;
packages = with pkgs; [];
};
nix.settings.trusted-users = ["c"];
environment.systemPackages = with pkgs; [
vim
wget
fzf
nil
killall
gcc
pkg-config
];
environment = {
variables = {EDITOR = "nvim";};
sessionVariables = {NIXOS_OZONE_WL = "1";};
shells = with pkgs; [fish];
etc."greetd/environments".text = ''
hyprland
'';
};
fonts.packages = with pkgs; [nerdfonts meslo-lgs-nf];
}

View file

@ -0,0 +1,10 @@
{
virtualisation = {
libvirtd.enable = true;
podman = {
enable = true;
dockerCompat = true;
defaultNetwork.settings.dns_enabled = true;
};
};
}

View file

@ -1,5 +1,14 @@
{ {
modules = [./hardware-configuration.nix]; modules = [
./hardware-configuration.nix
./configuration.nix
./containers.nix
./networking.nix
./ssh.nix
./programs.nix
./home.nix
./styling.nix
];
extraArgs = {}; extraArgs = {};
specialArgs = {}; specialArgs = {};
system = "x86_64-linux"; system = "x86_64-linux";

View file

@ -12,9 +12,48 @@
initrd.kernelModules = []; initrd.kernelModules = [];
kernelModules = ["kvm-intel"]; kernelModules = ["kvm-intel"];
extraModulePackages = []; extraModulePackages = [];
#kernelPackages = pkgs.linuxPackages_latest;
};
hardware = {
bluetooth = {
enable = true;
powerOnBoot = true;
settings = {General = {Enable = "Source,Sink,Media,Socket";};};
}; };
#boot.kernelPackages = pkgs.linuxPackages_latest; opengl = {
# hardware.graphics on unstable
enable = true;
extraPackages = with pkgs; [
intel-media-driver # LIBVA_DRIVER_NAME=iHD
intel-vaapi-driver # LIBVA_DRIVER_NAME=i965 (older but works better for Firefox/Chromium)
libvdpau-va-gl
vaapiVdpau
intel-compute-runtime
unstable.vpl-gpu-rt
];
};
cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
};
environment.sessionVariables = {LIBVA_DRIVER_NAME = "iHD";}; # Force intel-media-driver
services = {
blueman.enable = true;
power-profiles-daemon.enable = false;
system76-scheduler.settings.cfsProfiles.enable = true;
tlp = {
enable = true;
settings = {
CPU_BOOST_ON_AC = 1;
CPU_BOOST_ON_BAT = 0;
CPU_SCALING_GOVERNOR_ON_AC = "performance";
CPU_SCALING_GOVERNOR_ON_BAT = "powersave";
};
};
};
powerManagement.powertop.enable = true;
fileSystems."/" = { fileSystems."/" = {
device = "/dev/disk/by-uuid/5488764f-a50a-4ea2-ac8d-bfe565199018"; device = "/dev/disk/by-uuid/5488764f-a50a-4ea2-ac8d-bfe565199018";
@ -24,6 +63,4 @@
swapDevices = []; swapDevices = [];
networking.useDHCP = lib.mkDefault true; networking.useDHCP = lib.mkDefault true;
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
} }

13
hosts/artemis/home.nix Normal file
View file

@ -0,0 +1,13 @@
{inputs, ...}: {
home-manager = {
sharedModules = [
{
stylix.targets = {
fish.enable = false;
};
}
];
users.c = import ../../home;
extraSpecialArgs = {inherit inputs;};
};
}

View file

@ -0,0 +1,10 @@
{config, ...}: {
networking = {
hostName = "artemis";
networkmanager.enable = true;
firewall.enable = true;
firewall.allowPing = true;
enableIPv6 = false;
nameservers = ["9.9.9.9" "149.112.112.112"];
};
}

View file

@ -0,0 +1,45 @@
{pkgs, ...}: {
programs = {
fish.enable = true;
seahorse.enable = true;
nix-ld.enable = true;
virt-manager.enable = true;
nm-applet.enable = true;
hyprland.enable = true;
};
services = {
mullvad-vpn = {
enable = true;
package = pkgs.mullvad-vpn;
};
dbus.enable = true;
printing.enable = true;
udisks2.enable = true;
pipewire = {
enable = true;
alsa = {
enable = true;
support32Bit = true;
};
pulse.enable = true;
wireplumber.enable = true;
#jack.enable = true;
};
thermald.enable = true;
greetd = {
enable = true;
settings = {
default_session.command = ''
${pkgs.greetd.tuigreet}/bin/tuigreet \
--time \
--asterisks \
--user-menu \
--cmd Hyprland
'';
};
};
};
}

10
hosts/artemis/ssh.nix Normal file
View file

@ -0,0 +1,10 @@
{
services.openssh = {
enable = true;
settings = {
PasswordAuthentication = true;
KbdInteractiveAuthentication = true;
PermitRootLogin = "no";
};
};
}

57
hosts/artemis/styling.nix Normal file
View file

@ -0,0 +1,57 @@
{pkgs, ...}: {
stylix = {
enable = true;
image = pkgs.fetchurl {
url = "https://i.redd.it/jd1nuwsl0d121.jpg";
sha256 = "sha256-ff3ajGVsay2dtHiHmO2MYlqCvexUQjGifMs/ofzuyvI=";
};
polarity = "dark";
base16Scheme = "${pkgs.base16-schemes}/share/themes/onedark.yaml";
cursor = {
# package = pkgs.bibata-cursors;
# name = "Bibata-Modern-Ice";
package = pkgs.apple-cursor;
name = "macOS-Monterey";
size = 8;
};
fonts = {
monospace = {
package = pkgs.nerdfonts.override {fonts = ["JetBrainsMono"];};
name = "JetBrainsMono Nerd Font Mono";
};
sansSerif = {
package = pkgs.dejavu_fonts;
name = "DejaVu Sans";
};
serif = {
package = pkgs.dejavu_fonts;
name = "DejaVu Serif";
};
sizes = {
applications = 12;
terminal = 12;
desktop = 10;
popups = 10;
};
};
opacity = {
applications = 1.0;
terminal = 1.0;
desktop = 1.0;
popups = 1.0;
};
targets = {
fish.enable = false;
};
};
}

View file

@ -1,6 +1,6 @@
{utils}: let {utils}: let
hosts = utils.lib.exportModules [ hosts = utils.lib.exportModules [
# ./artemis ./artemis
./hermes ./hermes
]; ];
in {inherit hosts;} in {inherit hosts;}

View file

@ -27,6 +27,8 @@ in {
]; ];
}; };
nix.settings.trusted-users = ["media"];
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
wget wget
tree tree

View file

@ -4,8 +4,8 @@
pkgs, pkgs,
... ...
}: { }: {
networking.hostName = "hermes";
networking = { networking = {
hostName = "hermes";
enableIPv6 = false; enableIPv6 = false;
firewall.allowedTCPPorts = [80 443 8265]; firewall.allowedTCPPorts = [80 443 8265];
firewall.checkReversePath = false; firewall.checkReversePath = false;

View file

@ -1,5 +1,10 @@
{ {
nix = { nix = {
gc = {
automatic = true;
dates = "weekly";
options = "--delete-older-than 7d";
};
extraOptions = "gc-keep-outputs = true"; extraOptions = "gc-keep-outputs = true";
settings = { settings = {
experimental-features = ["nix-command" "flakes"]; experimental-features = ["nix-command" "flakes"];

View file

@ -6,5 +6,5 @@ let
}; };
allSystems = builtins.attrValues systems; allSystems = builtins.attrValues systems;
in { in {
"wg-conf.age".publicKeys = keys.c ++ [systems.hermes]; "wg-conf.age".publicKeys = keys.c ++ allSystems;
} }

Binary file not shown.