Add pre-commit hooks and fix style issues

This commit is contained in:
Erwin Boskma 2022-11-19 20:00:54 +01:00
parent c042fe2a77
commit 8637b08182
Signed by: erwin
SSH key fingerprint: SHA256:CyeNoWXd3kjX2Nwu6pDxxdS7OqmPVOy0NavA/KU/ntU
56 changed files with 229 additions and 302 deletions

1
.gitignore vendored
View file

@ -2,3 +2,4 @@
/result /result
/secrets.nix /secrets.nix
/.direnv /.direnv
/.pre-commit-config.yaml

View file

@ -38,31 +38,20 @@
"type": "github" "type": "github"
} }
}, },
"flake-utils_2": {
"locked": {
"lastModified": 1667395993,
"narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"ha-now-playing": { "ha-now-playing": {
"inputs": { "inputs": {
"flake-utils": "flake-utils_2", "flake-utils": [
"flake-utils"
],
"naersk": [ "naersk": [
"naersk" "naersk"
], ],
"nixpkgs": [ "nixpkgs": [
"nixpkgs" "nixpkgs"
], ],
"pre-commit-hooks": "pre-commit-hooks", "pre-commit-hooks": [
"pre-commit-hooks"
],
"rust-overlay": [ "rust-overlay": [
"rust-overlay" "rust-overlay"
] ]
@ -111,11 +100,11 @@
"wlroots": "wlroots" "wlroots": "wlroots"
}, },
"locked": { "locked": {
"lastModified": 1668863695, "lastModified": 1668879337,
"narHash": "sha256-PFNI4C5W5GjTwwnewSbTTSg7NTrBYcwBFR8RgxJb0t4=", "narHash": "sha256-Lm9054CdFfOvHTLTtktSuOFri3k5wuEXb2LDDg44tb8=",
"owner": "Hyprwm", "owner": "Hyprwm",
"repo": "Hyprland", "repo": "Hyprland",
"rev": "0ffaa8d6673c02e9360865c8cde69a606c036af7", "rev": "5530cf6e7939365ef6197a50c59bed20a64e3e11",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -167,11 +156,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1668790324, "lastModified": 1668876315,
"narHash": "sha256-WPPvwnzY+RLqBC7TESfRbvfnKN4v5Sjz3MY7BD7nm3E=", "narHash": "sha256-7zGrnFju+sDuH5xkiyQomR1UROtmLI+UvR2zJG4vEi0=",
"owner": "nix-community", "owner": "nix-community",
"repo": "nixos-generators", "repo": "nixos-generators",
"rev": "02e332e8d01c5901dafaef15555384add24630cd", "rev": "87f6494e9daedaa583eb2b61d25e6d925193fb57",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -197,16 +186,18 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1667292599, "lastModified": 1668765800,
"narHash": "sha256-7ISOUI1aj6UKMPIL+wwthENL22L3+A9V+jS8Is3QsRo=", "narHash": "sha256-rC40+/W6Hio7b/RsY8SvQPKNx4WqNcTgfYv8cUMAvJk=",
"owner": "NixOS", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "ef2f213d9659a274985778bff4ca322f3ef3ac68", "rev": "52b2ac8ae18bbad4374ff0dd5aeee0fdf1aea739",
"type": "github" "type": "github"
}, },
"original": { "original": {
"id": "nixpkgs", "owner": "nixos",
"type": "indirect" "ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
} }
}, },
"nixpkgs-22_05": { "nixpkgs-22_05": {
@ -225,22 +216,6 @@
"type": "github" "type": "github"
} }
}, },
"nixpkgs_2": {
"locked": {
"lastModified": 1668765800,
"narHash": "sha256-rC40+/W6Hio7b/RsY8SvQPKNx4WqNcTgfYv8cUMAvJk=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "52b2ac8ae18bbad4374ff0dd5aeee0fdf1aea739",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"pamedia": { "pamedia": {
"inputs": { "inputs": {
"naersk": [ "naersk": [
@ -271,17 +246,18 @@
"pre-commit-hooks": { "pre-commit-hooks": {
"inputs": { "inputs": {
"flake-utils": [ "flake-utils": [
"ha-now-playing",
"flake-utils" "flake-utils"
], ],
"nixpkgs": "nixpkgs" "nixpkgs": [
"nixpkgs"
]
}, },
"locked": { "locked": {
"lastModified": 1667992213, "lastModified": 1668880995,
"narHash": "sha256-8Ens8ozllvlaFMCZBxg6S7oUyynYx2v7yleC5M0jJsE=", "narHash": "sha256-1pohNJx6MIVeYpXmsugZG3fUKPSIKpQouttWFVfqsNU=",
"owner": "cachix", "owner": "cachix",
"repo": "pre-commit-hooks.nix", "repo": "pre-commit-hooks.nix",
"rev": "ebcbfe09d2bd6d15f68de3a0ebb1e4dcb5cd324b", "rev": "364568e63556045ea9d08d29fafa46febbdb015b",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -300,8 +276,9 @@
"naersk": "naersk", "naersk": "naersk",
"nixos-generators": "nixos-generators", "nixos-generators": "nixos-generators",
"nixos-hardware": "nixos-hardware", "nixos-hardware": "nixos-hardware",
"nixpkgs": "nixpkgs_2", "nixpkgs": "nixpkgs",
"pamedia": "pamedia", "pamedia": "pamedia",
"pre-commit-hooks": "pre-commit-hooks",
"rust-overlay": "rust-overlay", "rust-overlay": "rust-overlay",
"sops": "sops", "sops": "sops",
"sunshine": "sunshine" "sunshine": "sunshine"
@ -394,11 +371,11 @@
"flake": false, "flake": false,
"locked": { "locked": {
"host": "gitlab.freedesktop.org", "host": "gitlab.freedesktop.org",
"lastModified": 1668292512, "lastModified": 1668785720,
"narHash": "sha256-lCMnIguyZgAGq7W2IwIVPoQS8fAfZ/XFwz/1TQ53eI8=", "narHash": "sha256-CX+PYJP2PxZWL380WzyMNsrfRgIb/78brdwvDg/zj28=",
"owner": "wlroots", "owner": "wlroots",
"repo": "wlroots", "repo": "wlroots",
"rev": "627a5c511278e67c3c308cdc6a639cbb490f48c3", "rev": "4ff46e6cf9463e594605928feeb7c55cf323b5e7",
"type": "gitlab" "type": "gitlab"
}, },
"original": { "original": {

View file

@ -13,6 +13,12 @@
nixos-hardware.url = "github:NixOS/nixos-hardware"; nixos-hardware.url = "github:NixOS/nixos-hardware";
pre-commit-hooks = {
url = "github:cachix/pre-commit-hooks.nix";
inputs.flake-utils.follows = "flake-utils";
inputs.nixpkgs.follows = "nixpkgs";
};
nixos-generators = { nixos-generators = {
url = "github:nix-community/nixos-generators"; url = "github:nix-community/nixos-generators";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
@ -48,9 +54,10 @@
ha-now-playing = { ha-now-playing = {
url = "git+https://git.datarift.nl/erwin/ha-now-playing.git?ref=main"; url = "git+https://git.datarift.nl/erwin/ha-now-playing.git?ref=main";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
inputs.utils.follows = "flake-utils"; inputs.flake-utils.follows = "flake-utils";
inputs.naersk.follows = "naersk"; inputs.naersk.follows = "naersk";
inputs.rust-overlay.follows = "rust-overlay"; inputs.rust-overlay.follows = "rust-overlay";
inputs.pre-commit-hooks.follows = "pre-commit-hooks";
}; };
pamedia = { pamedia = {
@ -69,7 +76,6 @@
outputs = outputs =
{ self { self
, nixos-hardware
, sops , sops
, ha-now-playing , ha-now-playing
, pamedia , pamedia
@ -94,8 +100,9 @@
self.overlays.default self.overlays.default
ha-now-playing.overlays.${system} ha-now-playing.overlays.${system}
pamedia.overlays.${system} pamedia.overlays.${system}
inputs.emacs-overlay.overlay
] ++ nixpkgs.lib.optional (system == "aarch64-linux") ] ++ nixpkgs.lib.optional (system == "aarch64-linux")
(final: super: { (_final: super: {
makeModulesClosure = x: makeModulesClosure = x:
super.makeModulesClosure (x // { allowMissing = true; }); super.makeModulesClosure (x // { allowMissing = true; });
}); });
@ -140,11 +147,11 @@
nixosConfigurations = builtins.listToAttrs (map nixosConfigurations = builtins.listToAttrs (map
(machine: { (machine: {
name = machine; name = machine;
value = (defSystem (machines.${machine}.system or "x86_64-linux") { value = defSystem (machines.${machine}.system or "x86_64-linux") {
imports = [ imports = [
machines.${machine}.config machines.${machine}.config
]; ];
}); };
}) })
(builtins.attrNames machines)); (builtins.attrNames machines));
} }
@ -180,8 +187,26 @@
backscrub = flake-utils.lib.mkApp { drv = packages.backscrub; }; backscrub = flake-utils.lib.mkApp { drv = packages.backscrub; };
}; };
checks = {
pre-commit-check = pre-commit-hooks.lib.${system}.run {
src = ./.;
hooks = {
nixpkgs-fmt.enable = true;
deadnix.enable = true;
statix.enable = true;
black.enable = true;
shellcheck = {
enable = true;
types_or = [ "executable" ];
};
shfmt.enable = true;
};
};
};
devShells.default = with pkgs; devShells.default = with pkgs;
mkShell { mkShell {
inherit (self.checks.${system}.pre-commit-check) shellHook;
name = "dotfiles"; name = "dotfiles";
nativeBuildInputs = [ nativeBuildInputs = [
pkgs.sops pkgs.sops

View file

@ -1,5 +1,4 @@
{ pkgs { config
, config
, lib , lib
, ... , ...
}: }:

View file

@ -1,5 +1,4 @@
{ lib { lib
, pkgs
, config , config
, ... , ...
}: }:

View file

@ -1,5 +1,4 @@
{ pkgs { config
, config
, lib , lib
, ... , ...
}: }:

View file

@ -18,15 +18,6 @@ with lib; let
mimeTypes = [ "x-scheme-handler/org-protocol" ]; mimeTypes = [ "x-scheme-handler/org-protocol" ];
startupWMClass = "Emacs"; startupWMClass = "Emacs";
}; };
valeToINI = generators.toINIWithGlobalSection {
mkKeyValue = generators.mkKeyValueDefault
{
mkValueString = v:
if builtins.isList v then builtins.concatStringsSep ", " v
else generators.mkValueStringDefault { } v;
} " = ";
};
in in
{ {
options.eboskma.programs.emacs = { options.eboskma.programs.emacs = {

View file

@ -1,8 +1,4 @@
{ lib { lib, config, ... }:
, pkgs
, config
, ...
}:
with lib; let with lib; let
cfg = config.eboskma.programs.foot; cfg = config.eboskma.programs.foot;
in in

View file

@ -20,7 +20,7 @@ in
{ {
options.eboskma.programs.hyprland = { enable = mkEnableOption "Hyprland"; }; options.eboskma.programs.hyprland = { enable = mkEnableOption "Hyprland"; };
config = mkIf (cfg.enable) { config = mkIf cfg.enable {
wayland.windowManager.hyprland = { wayland.windowManager.hyprland = {
enable = true; enable = true;

View file

@ -1,4 +1,4 @@
#!/bin/bash # shellcheck disable=SC2148
confirm() { confirm() {
rofi -dmenu \ rofi -dmenu \
@ -22,18 +22,18 @@ lockcmd="i3lock --ignore-empty-password --show-failed-attempts --clock --color=3
chosen="$(echo -e "${options}" | rofi -theme power -p "Uptime: ${uptime}" -dmenu -selected-row 2)" chosen="$(echo -e "${options}" | rofi -theme power -p "Uptime: ${uptime}" -dmenu -selected-row 2)"
if [[ "${chosen}" == "" ]]; then if [[ ${chosen} == "" ]]; then
exit 0 exit 0
fi fi
if [[ "${chosen}" == "${lock}" ]]; then if [[ ${chosen} == "${lock}" ]]; then
${lockcmd} ${lockcmd}
exit 0 exit 0
fi fi
answer=$(confirm) answer=$(confirm)
if [[ "${answer}" == "y" ]]; then if [[ ${answer} == "y" ]]; then
case "${chosen}" in case "${chosen}" in
"${shutdown}") "${shutdown}")
systemctl poweroff systemctl poweroff

View file

@ -9,7 +9,7 @@ in
{ {
options.eboskma.programs.mpd = { enable = mkEnableOption "mpd"; }; options.eboskma.programs.mpd = { enable = mkEnableOption "mpd"; };
config = mkIf (cfg.enable) { config = mkIf cfg.enable {
services.mpd = { services.mpd = {
enable = true; enable = true;
network = { network = {

View file

@ -1,7 +1,6 @@
{ pkgs { pkgs
, config , config
, lib , lib
, inputs
, ... , ...
}: }:
with lib; let with lib; let
@ -13,7 +12,7 @@ in
{ {
options.eboskma.programs.picom = { enable = mkEnableOption "activate picom"; }; options.eboskma.programs.picom = { enable = mkEnableOption "activate picom"; };
config = mkIf (cfg.enable) { config = mkIf cfg.enable {
# home.packages = [pkgs.nixgl.auto.nixGLDefault]; # home.packages = [pkgs.nixgl.auto.nixGLDefault];
services.picom = { services.picom = {

View file

@ -65,7 +65,7 @@ in
{ {
options.eboskma.programs.polybar = { enable = mkEnableOption "activate polybar"; }; options.eboskma.programs.polybar = { enable = mkEnableOption "activate polybar"; };
config = mkIf (cfg.enable) { config = mkIf cfg.enable {
# systemd.user.services.polybar = { # systemd.user.services.polybar = {
# Install = { WantedBy = [ "graphical-session.target" ]; }; # Install = { WantedBy = [ "graphical-session.target" ]; };
# }; # };

View file

@ -6,27 +6,29 @@ import gi
from gi.repository import GLib from gi.repository import GLib
# Check Playerctl version # Check Playerctl version
gi.require_version('Playerctl', '2.0') gi.require_version("Playerctl", "2.0")
from gi.repository import Playerctl from gi.repository import Playerctl
def player_status_str(status): def player_status_str(status):
if status == Playerctl.PlaybackStatus.PLAYING: if status == Playerctl.PlaybackStatus.PLAYING:
return 'Playing' return "Playing"
elif status == Playerctl.PlaybackStatus.PAUSED: elif status == Playerctl.PlaybackStatus.PAUSED:
return 'Paused' return "Paused"
elif status == Playerctl.PlaybackStatus.STOPPED: elif status == Playerctl.PlaybackStatus.STOPPED:
return 'Stopped' return "Stopped"
else: else:
return 'Unknown' return "Unknown"
def now_playing_str(artist, title): def now_playing_str(artist, title):
if artist == None and title == None: if artist == None and title == None:
return 'No music information' return "No music information"
elif artist == None: elif artist == None:
return title return title
else: else:
return f'{artist} - {title}' return f"{artist} - {title}"
players = Playerctl.list_players() players = Playerctl.list_players()
@ -34,12 +36,12 @@ if len(players) == 0:
print("No players found") print("No players found")
exit(0) exit(0)
homedir = os.environ['HOME'] homedir = os.environ["HOME"]
player_file = f'{homedir}/.playerctl_player' player_file = f"{homedir}/.playerctl_player"
current_player_name = '' current_player_name = ""
if os.path.isfile(player_file): if os.path.isfile(player_file):
with open(player_file, mode='r') as file: with open(player_file, mode="r") as file:
current_player_name = file.read() current_player_name = file.read()
player_found = False player_found = False
@ -61,24 +63,24 @@ if len(sys.argv) == 1:
if player.props.playback_status == Playerctl.PlaybackStatus.PLAYING: if player.props.playback_status == Playerctl.PlaybackStatus.PLAYING:
out += now_playing_str(player.get_artist(), player.get_title()) out += now_playing_str(player.get_artist(), player.get_title())
else: else:
out += player_status_str(player.get_property('playback_status')) out += player_status_str(player.get_property("playback_status"))
print(out) print(out)
elif sys.argv[1] == 'next-player': elif sys.argv[1] == "next-player":
player_changed = True player_changed = True
player_index += 1 player_index += 1
if player_index == len(players): if player_index == len(players):
player_index = 0 player_index = 0
player = Playerctl.Player.new_from_name(players[player_index]) player = Playerctl.Player.new_from_name(players[player_index])
elif sys.argv[1] == 'play-pause': elif sys.argv[1] == "play-pause":
player.play_pause() player.play_pause()
elif sys.argv[1] == 'next': elif sys.argv[1] == "next":
player.next() player.next()
elif sys.argv[1] == 'previous': elif sys.argv[1] == "previous":
player.previous() player.previous()
if player_changed or not player_found: if player_changed or not player_found:
with open(player_file, mode='w') as file: with open(player_file, mode="w") as file:
file.write(player.get_property('player-instance')) file.write(player.get_property("player-instance"))
file.flush() file.flush()

View file

@ -1,5 +1,4 @@
{ pkgs { config
, config
, lib , lib
, ... , ...
}: }:
@ -18,7 +17,7 @@ in
hashKnownHosts = true; hashKnownHosts = true;
matchBlocks = { matchBlocks = {
"*" = { "*" = {
identityFile = (if var.workSystem then horusKey else personalKey); identityFile = if var.workSystem then horusKey else personalKey;
identitiesOnly = true; identitiesOnly = true;
extraOptions = { extraOptions = {
Ciphers = "chacha20-poly1305@openssh.com,aes256-gcm@openssh.com,aes128-gcm@openssh.com,aes256-ctr,aes192-ctr,aes128-ctr"; Ciphers = "chacha20-poly1305@openssh.com,aes256-gcm@openssh.com,aes128-gcm@openssh.com,aes256-ctr,aes192-ctr,aes128-ctr";
@ -63,7 +62,7 @@ in
}; };
"git.datarift.nl" = { "git.datarift.nl" = {
hostname = (if var.workSystem then "direct.datarift.nl" else "10.0.0.201"); hostname = if var.workSystem then "direct.datarift.nl" else "10.0.0.201";
}; };
fluiddpi = mkIf (!var.workSystem) { fluiddpi = mkIf (!var.workSystem) {

View file

@ -1,3 +1,5 @@
# shellcheck disable=SC2148
confirm() { confirm() {
rofi -dmenu \ rofi -dmenu \
-i \ -i \
@ -25,18 +27,18 @@ lockcmd="swaylock --ignore-empty-password --daemonize --show-failed-attempts --i
chosen="$(echo -e "${options}" | rofi -theme power -p "Uptime: ${uptime}" -dmenu -selected-row 2)" chosen="$(echo -e "${options}" | rofi -theme power -p "Uptime: ${uptime}" -dmenu -selected-row 2)"
if [[ "${chosen}" == "" ]]; then if [[ ${chosen} == "" ]]; then
exit 0 exit 0
fi fi
if [[ "${chosen}" == "${lock}" ]]; then if [[ ${chosen} == "${lock}" ]]; then
${lockcmd} ${lockcmd}
exit 0 exit 0
fi fi
answer=$(confirm) answer=$(confirm)
if [[ "${answer}" == "y" ]]; then if [[ ${answer} == "y" ]]; then
case "${chosen}" in case "${chosen}" in
"${shutdown}") "${shutdown}")
systemctl poweroff systemctl poweroff
@ -49,9 +51,9 @@ if [[ "${answer}" == "y" ]]; then
systemctl hibernate systemctl hibernate
;; ;;
"${exit_wm}") "${exit_wm}")
if [[ ${XDG_CURRENT_DESKTOP} = "sway" ]]; then if [[ ${XDG_CURRENT_DESKTOP} == "sway" ]]; then
swaymsg exit swaymsg exit
elif [[ ${XDG_CURRENT_DESKTOP} = "Hyprland" ]]; then elif [[ ${XDG_CURRENT_DESKTOP} == "Hyprland" ]]; then
hyprctl dispatch exit hyprctl dispatch exit
fi fi
;; ;;

View file

@ -1,7 +1,6 @@
{ lib { lib
, pkgs , pkgs
, config , config
, flake-inputs
, ... , ...
}: }:
with lib; let with lib; let

View file

@ -20,7 +20,7 @@ in
enable = mkEnableOption "wallpapers"; enable = mkEnableOption "wallpapers";
backgroundColor = mkOption { backgroundColor = mkOption {
description = "Hex value of the background color"; description = "Hex value of the background color";
type = (types.strMatching "#[[:xdigit:]]{6}"); type = types.strMatching "#[[:xdigit:]]{6}";
default = "#000000"; default = "#000000";
example = "#ff0000"; example = "#ff0000";
}; };

View file

@ -5,14 +5,6 @@
}: }:
with lib; let with lib; let
cfg = config.eboskma.programs.waybar; cfg = config.eboskma.programs.waybar;
wb-dunst = pkgs.writeShellScriptBin "wb-dunst" ''
COUNT=$(${pkgs.dunst}/bin/dunstctl count waiting)
ENABLED=" "
DISABLED=" "
if [[ ''${COUNT} != 0 ]]; then DISABLED=" ''${COUNT}"; fi
if ${pkgs.dunst}/bin/dunstctl is-paused | grep -q "false" ; then ${pkgs.coreutils}/bin/echo "''${ENABLED}"; else ${pkgs.coreutils}/bin/echo "''${DISABLED}"; fi
'';
in in
{ {
options.eboskma.programs.waybar.enable = mkEnableOption "Enable waybar"; options.eboskma.programs.waybar.enable = mkEnableOption "Enable waybar";

View file

@ -15,7 +15,7 @@ in
}; };
}; };
config = mkIf (cfg.enable) { config = mkIf cfg.enable {
systemd.user.services.xbanish = { systemd.user.services.xbanish = {
Unit = { Unit = {
Description = "xbanish hides the mouse pointer when typing"; Description = "xbanish hides the mouse pointer when typing";

View file

@ -1,5 +1,4 @@
{ pkgs { config
, config
, lib , lib
, ... , ...
}: }:

View file

@ -1,4 +1,4 @@
{ pkgs, config, lib, ... }: { config, lib, ... }:
with lib; with lib;
let let
cfg = config.eboskma.programs.zellij; cfg = config.eboskma.programs.zellij;
@ -13,7 +13,7 @@ in
}; };
}; };
config = mkIf (cfg.enable) { config = mkIf cfg.enable {
programs.zellij = { programs.zellij = {
enable = true; enable = true;
settings = { settings = {

View file

@ -5,7 +5,7 @@ let
lib = import "${krops}/lib"; lib = import "${krops}/lib";
pkgs = import "${krops}/pkgs" { }; pkgs = import "${krops}/pkgs" { };
source = name: source = _name:
lib.evalSource [ lib.evalSource [
{ {
machine-config.file = toString ./.; machine-config.file = toString ./.;

View file

@ -1,30 +1,30 @@
{ ... }@inputs: { inputs: {
drone = { drone = {
config = (import ./drone/configuration.nix inputs); config = import ./drone/configuration.nix inputs;
}; };
eitri = { eitri = {
system = "aarch64-linux"; system = "aarch64-linux";
config = (import ./eitri/configuration.nix inputs); config = import ./eitri/configuration.nix inputs;
}; };
gitea = { gitea = {
config = (import ./gitea/configuration.nix inputs); config = import ./gitea/configuration.nix inputs;
}; };
heimdall = { heimdall = {
config = (import ./heimdall/configuration.nix inputs); config = import ./heimdall/configuration.nix inputs;
}; };
loki = { loki = {
config = (import ./loki/configuration.nix inputs); config = import ./loki/configuration.nix inputs;
}; };
mimir = { mimir = {
config = (import ./mimir/configuration.nix inputs); config = import ./mimir/configuration.nix inputs;
}; };
proxy = { proxy = {
config = (import ./proxy/configuration.nix inputs); config = import ./proxy/configuration.nix inputs;
}; };
vm1 = { vm1 = {
config = (import ./vm1/configuration.nix inputs); config = import ./vm1/configuration.nix inputs;
}; };
vm2 = { vm2 = {
config = (import ./vm2/configuration.nix inputs); config = import ./vm2/configuration.nix inputs;
}; };
} }

View file

@ -1,7 +1,4 @@
{ config { modulesPath
, lib
, pkgs
, modulesPath
, ... , ...
}: { }: {
imports = [ imports = [

View file

@ -1,4 +1,4 @@
{ self, nixpkgs, nixos-hardware, ... }: { nixpkgs, nixos-hardware, ... }:
let let
pkgs = import nixpkgs { pkgs = import nixpkgs {
system = "aarch64-linux"; system = "aarch64-linux";

View file

@ -1,9 +1,4 @@
{ config { modulesPath, ... }: {
, lib
, pkgs
, modulesPath
, ...
}: {
imports = [ imports = [
(modulesPath + "/virtualisation/lxc-container.nix") (modulesPath + "/virtualisation/lxc-container.nix")
]; ];

View file

@ -1,9 +1,4 @@
{ config { modulesPath, ... }: {
, lib
, pkgs
, modulesPath
, ...
}: {
imports = [ imports = [
(modulesPath + "/virtualisation/proxmox-image.nix") (modulesPath + "/virtualisation/proxmox-image.nix")
]; ];

View file

@ -1,5 +1,5 @@
{ self, nixpkgs, nixos-hardware, hyprland, ... }: { nixos-hardware, ... }:
{ pkgs, config, ... }: { pkgs, ... }:
{ {
imports = [ imports = [
nixos-hardware.nixosModules.common-cpu-amd nixos-hardware.nixosModules.common-cpu-amd
@ -44,7 +44,11 @@
element-web.enable = false; element-web.enable = false;
fonts.enable = true; fonts.enable = true;
gnome.enable = true; gnome.enable = true;
greetd.enable = true; greetd = {
enable = true;
sway = true;
hyprland = false;
};
# home-manager = { # home-manager = {
# inherit (users) users; # inherit (users) users;
# enable = true; # enable = true;

View file

@ -1,7 +1,5 @@
{ config { config
, lib , lib
, pkgs
, modulesPath
, ... , ...
}: { }: {
boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "ahci" "usb_storage" "usbhid" "sd_mod" ]; boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "ahci" "usb_storage" "usbhid" "sd_mod" ];

View file

@ -2,7 +2,7 @@
# your system. Help is available in the configuration.nix(5) man page # your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running nixos-help). # and in the NixOS manual (accessible by running nixos-help).
{ self, nixpkgs, nixos-hardware, ... }: { nixos-hardware, ... }:
{ pkgs, ... }: { pkgs, ... }:
{ {
imports = imports =

View file

@ -1,7 +1,7 @@
# Do not modify this file! It was generated by nixos-generate-config # Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes # and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead. # to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }: { config, pkgs, ... }:
{ {
boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "ahci" "usb_storage" "usbhid" ]; boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "ahci" "usb_storage" "usbhid" ];

View file

@ -1,7 +1,4 @@
{ config { modulesPath
, lib
, pkgs
, modulesPath
, ... , ...
}: { }: {
imports = [ imports = [

View file

@ -1,4 +1,4 @@
{ self, ... }: { { ... }: {
imports = [ ./hardware-configuration.nix ]; imports = [ ./hardware-configuration.nix ];
eboskma = { eboskma = {

View file

@ -1,10 +1,7 @@
# Do not modify this file! It was generated by nixos-generate-config # Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes # and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead. # to /etc/nixos/configuration.nix instead.
{ config { modulesPath
, lib
, pkgs
, modulesPath
, ... , ...
}: { }: {
imports = [ imports = [

View file

@ -1,4 +1,4 @@
{ self, ... }: { { ... }: {
imports = [ ./hardware-configuration.nix ]; imports = [ ./hardware-configuration.nix ];
eboskma = { eboskma = {

View file

@ -1,12 +1,4 @@
# Do not modify this file! It was generated by nixos-generate-config { modulesPath, ... }: {
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{ config
, lib
, pkgs
, modulesPath
, ...
}: {
imports = [ imports = [
(modulesPath + "/profiles/qemu-guest.nix") (modulesPath + "/profiles/qemu-guest.nix")
]; ];

View file

@ -1,8 +1,4 @@
{ mkDerivation, lib }: { mkDerivation, lib }:
let
udevRules = ''
'';
in
mkDerivation mkDerivation
{ {
pname = "blink1-udev-rules"; pname = "blink1-udev-rules";

View file

@ -1,5 +1,4 @@
{ pkgs { config
, config
, lib , lib
, ... , ...
}: }:

View file

@ -1,8 +1,6 @@
{ lib { lib
, pkgs , pkgs
, config , config
, inputs
, self-overlay
, ... , ...
}: }:
with lib; let with lib; let

View file

@ -1,8 +1,4 @@
{ pkgs { config, lib, ... }:
, config
, lib
, ...
}:
with lib; let with lib; let
cfg = config.eboskma.drone; cfg = config.eboskma.drone;
in in

View file

@ -14,6 +14,8 @@ in
{ {
options.eboskma.greetd = { options.eboskma.greetd = {
enable = mkEnableOption "enable greetd"; enable = mkEnableOption "enable greetd";
sway = mkEnableOption "sway";
hyprland = mkEnableOption "hyprland";
}; };
config = config =
@ -46,11 +48,10 @@ in
group = "greeter"; group = "greeter";
}; };
"greetd/environments" = { "greetd/environments" = {
text = '' text = concatStringsSep "\n" ([ ]
${pkgs.sway}/bin/sway ++ (optional cfg.sway "${pkgs.sway}/bin/sway")
${hyprland}/bin/Hyprland ++ (optional cfg.hyprland "${hyprland}/bin/Hyprland")
${pkgs.bash}/bin/bash ++ [ "${pkgs.bash}/bin/bash" ]);
'';
user = "greeter"; user = "greeter";
group = "greeter"; group = "greeter";
}; };

View file

@ -1,4 +1,4 @@
{ pkgs, config, lib, ... }: { config, lib, ... }:
with lib; with lib;
let let
cfg = config.eboskma.lightdm; cfg = config.eboskma.lightdm;

View file

@ -1,5 +1,4 @@
{ pkgs { config
, config
, lib , lib
, ... , ...
}: }:

View file

@ -1,5 +1,4 @@
{ pkgs { config
, config
, lib , lib
, ... , ...
}: }:

View file

@ -1,4 +1,4 @@
{ pkgs, config, lib, ... }: { config, lib, ... }:
with lib; with lib;
let let
cfg = config.eboskma.nix-serve; cfg = config.eboskma.nix-serve;

View file

@ -1,12 +1,5 @@
{ lib { lib, ... }:
, pkgs with lib; {
, config
, ...
}:
with lib; let
cfg = config.eboskma.var;
in
{
options.eboskma.var = { options.eboskma.var = {
mainUser = lib.mkOption { mainUser = lib.mkOption {
type = lib.types.str; type = lib.types.str;

View file

@ -1,5 +1,4 @@
{ pkgs { config
, config
, lib , lib
, ... , ...
}: }:

View file

@ -1,4 +1,4 @@
{ pkgs, config, lib, ... }: { config, lib, ... }:
with lib; with lib;
let let
cfg = config.eboskma.tablet; cfg = config.eboskma.tablet;

View file

@ -1,4 +1,4 @@
final: prev: rec { _final: prev: rec {
rofi-wayland = prev.pkgs.callPackage ../pkgs/rofi-wayland { }; rofi-wayland = prev.pkgs.callPackage ../pkgs/rofi-wayland { };
nix-plugins = prev.pkgs.callPackage ../pkgs/nix-plugins { }; nix-plugins = prev.pkgs.callPackage ../pkgs/nix-plugins { };
lunarvim = prev.pkgs.callPackage ../pkgs/lunarvim { }; lunarvim = prev.pkgs.callPackage ../pkgs/lunarvim { };

View file

@ -1,4 +1,4 @@
{ lib, buildGoModule, fetchFromGitHub }: { buildGoModule, fetchFromGitHub, ... }:
let let
version = "2.2.18"; version = "2.2.18";
in in

View file

@ -1,5 +1,5 @@
disabled = [ disabled = [
"manual_inherit_from" "manual_inherit_from"
] ]
nix_version = "2.8" nix_version = "2.11"
ignore = [".direnv"] ignore = [".direnv"]

View file

@ -1,4 +1,4 @@
{ pkgs, config, lib, ... }: { config, lib, ... }:
with lib; with lib;
let let
cfg = config.eboskma.users.builder; cfg = config.eboskma.users.builder;

View file

@ -4,7 +4,19 @@ let
cfg = config.eboskma.users.erwin; cfg = config.eboskma.users.erwin;
in in
{ {
options.eboskma.users.erwin = { enable = mkEnableOption "user account for Erwin"; }; options.eboskma.users.erwin = {
enable = mkEnableOption "user account for Erwin";
home = mkEnableOption "home profile";
work = mkEnableOption "work profile";
terminal = mkOption {
type = types.str;
default = "foot";
description = "Terminal emulator to use. Specify the .desktop filename, e.g. 'foot' or 'Alacritty'";
};
};
imports = [ ./home.nix ./work.nix ]; imports = [ ./home.nix ./work.nix ];

View file

@ -1,24 +1,9 @@
{ pkgs { pkgs, config, lib, inputs, self-overlay, ... }:
, config
, lib
, inputs
, self-overlay
, ...
}:
with lib; let with lib; let
cfg = config.eboskma.users.erwin; cfg = config.eboskma.users.erwin;
bt = config.eboskma.bluetooth; bt = config.eboskma.bluetooth;
in in
{ {
options.eboskma.users.erwin = {
home = mkEnableOption "home profile";
terminal = mkOption {
type = types.str;
default = "foot";
description = "Terminal emulator to use. Specify the .desktop filename, e.g. 'foot' or 'Alacritty'";
};
};
config = config =
mkIf cfg.home { mkIf cfg.home {
home-manager.users.erwin = { home-manager.users.erwin = {
@ -35,7 +20,7 @@ in
EDITOR = "${pkgs.neovim}/bin/nvim"; EDITOR = "${pkgs.neovim}/bin/nvim";
}; };
nixpkgs.config = { allowUnfree = true; }; nixpkgs.config.allowUnfree = true;
home.stateVersion = "21.11"; home.stateVersion = "21.11";
@ -69,7 +54,7 @@ in
signingKeyFormat = "ssh"; signingKeyFormat = "ssh";
}; };
gpg.enable = true; gpg.enable = true;
hyprland.enable = true; hyprland.enable = false;
neovim.enable = true; neovim.enable = true;
obs-studio.enable = true; obs-studio.enable = true;
rclone = { rclone = {

View file

@ -4,11 +4,7 @@ let
cfg = config.eboskma.users.erwin; cfg = config.eboskma.users.erwin;
in in
{ {
options.eboskma.users.erwin = { config = mkIf cfg.work {
work = mkEnableOption "work profile";
};
config = mkIf (cfg.work) {
home-manager.users.erwin = { home-manager.users.erwin = {
_module.args.flake-inputs = inputs; _module.args.flake-inputs = inputs;