diff --git a/Makefile b/Makefile index 36ce56d..9e806cc 100644 --- a/Makefile +++ b/Makefile @@ -4,7 +4,7 @@ SHELL := bash MAKEFLAGS += --warn-undefined-variables MAKEFLAGS += --no-builtin-rules -HOSTAME ?= $(shell hostname) +HOSTNAME ?= $(shell hostname) UNAME_S := $(shell uname -s) ifeq ($(UNAME_S),Linux) @@ -19,3 +19,6 @@ switch: update: nix flake update + +fmt: + alejandra . diff --git a/common/darwin.nix b/common/darwin.nix index 267fc67..10b8bc9 100644 --- a/common/darwin.nix +++ b/common/darwin.nix @@ -1,5 +1,3 @@ -{ pkgs, ... }: - -{ +{pkgs, ...}: { nix.extraOptions = "experimental-features = nix-command flakes"; } diff --git a/common/desktop.nix b/common/desktop.nix index dc8b6ef..9147023 100644 --- a/common/desktop.nix +++ b/common/desktop.nix @@ -1,7 +1,4 @@ -{ ... }: - -{ - +{...}: { services.xserver = { enable = true; displayManager = { diff --git a/common/fonts.nix b/common/fonts.nix index 61c76b6..d4169e4 100644 --- a/common/fonts.nix +++ b/common/fonts.nix @@ -1,6 +1,4 @@ -{ pkgs, ... }: - -{ +{pkgs, ...}: { # Set system-wide fonts. fonts.fonts = with pkgs; [ dejavu_fonts @@ -18,9 +16,9 @@ # Set default fonts. fonts.fontconfig.defaultFonts = { - sansSerif = [ "Noto Sans" ]; - serif = [ "Noto Serif" ]; - monospace = [ "Noto Sans Mono" ]; - emoji = [ "Noto Color Emoji" ]; + sansSerif = ["Noto Sans"]; + serif = ["Noto Serif"]; + monospace = ["Noto Sans Mono"]; + emoji = ["Noto Color Emoji"]; }; } diff --git a/common/linux.nix b/common/linux.nix index d8ece39..d651ce8 100644 --- a/common/linux.nix +++ b/common/linux.nix @@ -1,8 +1,6 @@ -{ pkgs, ... }: - -{ +{pkgs, ...}: { boot.kernelPackages = pkgs.linuxPackages; - boot.supportedFilesystems = [ "ntfs" ]; + boot.supportedFilesystems = ["ntfs"]; system.stateVersion = "unstable"; system.autoUpgrade.enable = true; @@ -19,7 +17,7 @@ users.users.dave = { isNormalUser = true; - extraGroups = [ "docker" "wheel" "libvirtd" ]; + extraGroups = ["docker" "wheel" "libvirtd"]; shell = pkgs.zsh; }; @@ -36,7 +34,7 @@ # Enable 32bit for steam hardware.pulseaudio.enable = true; hardware.opengl.driSupport32Bit = true; - hardware.opengl.extraPackages32 = with pkgs.pkgsi686Linux; [ libva ]; + hardware.opengl.extraPackages32 = with pkgs.pkgsi686Linux; [libva]; hardware.pulseaudio.support32Bit = true; virtualisation.docker.enable = true; @@ -47,5 +45,4 @@ enable = true; enableSSHSupport = true; }; - } diff --git a/common/networking.nix b/common/networking.nix index 046d3e5..b0e1120 100644 --- a/common/networking.nix +++ b/common/networking.nix @@ -1,6 +1,4 @@ -{ pkgs, ... }: - -{ +{pkgs, ...}: { services.tailscale.enable = true; networking = { @@ -8,7 +6,7 @@ allowPing = false; enable = true; checkReversePath = "loose"; - trustedInterfaces = [ "tailscale0" ]; + trustedInterfaces = ["tailscale0"]; }; }; } diff --git a/common/packages.nix b/common/packages.nix index 750a859..7d153b2 100644 --- a/common/packages.nix +++ b/common/packages.nix @@ -1,12 +1,15 @@ -{ config, lib, pkgs, ... }: - -let inherit (pkgs) stdenv; -in { + config, + lib, + pkgs, + ... +}: let + inherit (pkgs) stdenv; +in { # System-wide packages to install. - environment.systemPackages = with pkgs; - let - common = [ + environment.systemPackages = with pkgs; let + common = + [ # essentials curl gcc @@ -119,10 +122,13 @@ in terraformer tflint tfsec - /* tfswitch */ + /* + tfswitch + */ infracost # nix + alejandra cachix nix-diff nixfmt @@ -157,8 +163,8 @@ in # news srv - - ] ++ lib.optionals stdenv.isLinux ([ + ] + ++ lib.optionals stdenv.isLinux [ _1password-gui albert authy @@ -202,8 +208,8 @@ in wireshark-qt yaru-theme zoom-us - ]); - in + ]; + in common; programs.gnupg.agent.enable = true; diff --git a/common/printing.nix b/common/printing.nix index 5143b7d..744d24c 100644 --- a/common/printing.nix +++ b/common/printing.nix @@ -1,5 +1,3 @@ -{ pkgs, ... }: - -{ +{pkgs, ...}: { services.printing.enable = true; } diff --git a/default.nix b/default.nix index 70b837d..595e83e 100644 --- a/default.nix +++ b/default.nix @@ -1,13 +1,13 @@ let - nix-pre-commit-hooks = import (builtins.fetchTarball + nix-pre-commit-hooks = + import (builtins.fetchTarball "https://github.com/cachix/pre-commit-hooks.nix/tarball/master"); -in -{ +in { pre-commit-check = nix-pre-commit-hooks.run { src = ./.; hooks = { shellcheck.enable = true; - nixpkgs-fmt.enable = true; + alejandra.enable = true; }; }; } diff --git a/flake.nix b/flake.nix index 01e09e6..abd4148 100644 --- a/flake.nix +++ b/flake.nix @@ -19,76 +19,90 @@ }; }; - outputs = { self, darwin, home-manager, nixpkgs, nixos-hardware, ... }@inputs: { + outputs = { + self, + darwin, + home-manager, + nixpkgs, + nixos-hardware, + ... + } @ inputs: { + nixosConfigurations = let + defaultModules = [ + home-manager.nixosModules.home-manager + ./common/desktop.nix + ./common/fonts.nix + ./common/linux.nix + ./common/networking.nix + ./common/packages.nix + ./common/printing.nix - nixosConfigurations = - let - defaultModules = [ - home-manager.nixosModules.home-manager - ./common/desktop.nix - ./common/fonts.nix - ./common/linux.nix - ./common/netdata/default.nix - ./common/networking.nix - ./common/packages.nix - ./common/printing.nix + ./services/netdata/default.nix + ./services/keyleds/default.nix - ({ config, lib, lib', ... }: { - config = { - _module.args = { - lib' = lib // import ./lib { inherit config lib; }; - }; - - nix = { - settings = { - auto-optimise-store = true; - sandbox = false; - substituters = [ "https://davegallant.cachix.org" ]; - trusted-users = [ "root" "dave" ]; - trusted-public-keys = [ - "davegallant.cachix.org-1:SsUMqL4+tF2R3/G6X903E9laLlY1rES2QKFfePegF08=" - ]; - }; - registry = { nixpkgs.flake = nixpkgs; }; - }; - - nixpkgs.overlays = [ - (import ./modules/overlays) - inputs.neovim-nightly-overlay.overlay - ]; - - home-manager = { - useGlobalPkgs = true; - useUserPackages = true; - users.dave.imports = [ ./home/default.nix ]; - }; + ({ + config, + lib, + lib', + ... + }: { + config = { + _module.args = { + lib' = lib // import ./lib {inherit config lib;}; }; - }) - ]; - in - { - hephaestus = nixpkgs.lib.nixosSystem { - system = "x86_64-linux"; - modules = [ + + nix = { + settings = { + auto-optimise-store = true; + sandbox = false; + substituters = ["https://davegallant.cachix.org"]; + trusted-users = ["root" "dave"]; + trusted-public-keys = [ + "davegallant.cachix.org-1:SsUMqL4+tF2R3/G6X903E9laLlY1rES2QKFfePegF08=" + ]; + }; + registry = {nixpkgs.flake = nixpkgs;}; + }; + + nixpkgs.overlays = [ + (import ./modules/overlays) + inputs.neovim-nightly-overlay.overlay + ]; + + home-manager = { + useGlobalPkgs = true; + useUserPackages = true; + users.dave.imports = [./home/default.nix]; + }; + }; + }) + ]; + in { + hephaestus = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + modules = + [ ./machines/hephaestus/configuration.nix ./machines/hephaestus/hardware.nix - ] ++ defaultModules; - }; + ] + ++ defaultModules; }; + }; darwinConfigurations = { demeter = darwin.lib.darwinSystem { - system = "x86_64-darwin"; modules = [ home-manager.darwinModules.home-manager ./common/darwin.nix ./common/packages.nix + ./machines/demeter/configuration.nix + ./modules/darwin/default.nix - ({ config, ... }: { + ({config, ...}: { config = { nixpkgs.overlays = [ inputs.neovim-nightly-overlay.overlay @@ -97,7 +111,7 @@ home-manager = { useGlobalPkgs = true; useUserPackages = true; - users.dave.imports = [ ./home/default.nix ]; + users.dave.imports = [./home/default.nix]; }; }; }) @@ -106,4 +120,3 @@ }; }; } - diff --git a/home/default.nix b/home/default.nix index 9dd499a..4dacd26 100644 --- a/home/default.nix +++ b/home/default.nix @@ -1,9 +1,11 @@ -{ lib, pkgs, ... }: - -let +{ + lib, + pkgs, + ... +}: let hound-nvim = pkgs.vimUtils.buildVimPlugin { name = "hound-nvim"; - nativeBuildInputs = with pkgs; [ lua53Packages.luacheck stylua ]; + nativeBuildInputs = with pkgs; [lua53Packages.luacheck stylua]; src = pkgs.fetchFromGitHub { owner = "davegallant"; repo = "hound.nvim"; @@ -12,9 +14,7 @@ let }; }; inherit (pkgs) stdenv; -in -{ - +in { services = { gpg-agent = { enable = stdenv.isLinux; @@ -27,7 +27,6 @@ in fonts.fontconfig.enable = true; programs = { - home-manager.enable = true; direnv.enable = true; @@ -50,18 +49,16 @@ in dc = "diff --cached"; dcn = "diff --cached --name-only"; ds = "! git diff origin | sed -r 's/value: (.*)/value: \"************\"/'"; - l = - "log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"; + l = "log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"; ms = "merge --squash"; p = "push origin"; pf = "push -f"; pl = "! git pull origin $(git rev-parse --abbrev-ref HEAD)"; st = "status"; - wip = - "for-each-ref --sort='authordate:iso8601' --format=' %(color:green)%(authordate:relative)%09%(color:white)%(refname:short)' refs/heads"; + wip = "for-each-ref --sort='authordate:iso8601' --format=' %(color:green)%(authordate:relative)%09%(color:white)%(refname:short)' refs/heads"; }; - includes = [{ path = "~/.gitconfig-work"; }]; + includes = [{path = "~/.gitconfig-work";}]; delta = { enable = true; @@ -79,10 +76,9 @@ in }; extraConfig = { - push = { default = "current"; }; - pull = { rebase = true; }; + push = {default = "current";}; + pull = {rebase = true;}; }; - }; starship = { @@ -91,9 +87,9 @@ in settings = { add_newline = false; - gcloud = { disabled = true; }; + gcloud = {disabled = true;}; scan_timeout = 10; - character = { error_symbol = "[✖](bold red)"; }; + character = {error_symbol = "[✖](bold red)";}; }; }; @@ -162,7 +158,6 @@ in "tmux" ]; }; - }; alacritty = { @@ -175,20 +170,19 @@ in mouse.hide_when_typing = true; font = - if stdenv.isLinux then - { - normal.family = "Fira Code"; - size = 12; - } - else - { - normal.family = "FiraCode Nerd Font"; - size = 18; - }; + if stdenv.isLinux + then { + normal.family = "Fira Code"; + size = 12; + } + else { + normal.family = "FiraCode Nerd Font"; + size = 18; + }; shell = { program = "zsh"; - args = [ "-l" "-c" "tmux" "u" ]; + args = ["-l" "-c" "tmux" "u"]; }; colors = { @@ -330,7 +324,9 @@ in extraConfig = "lua require('init')"; plugins = with pkgs.vimPlugins; [ - /* copilot-vim */ + /* + copilot-vim + */ cmp-nvim-lsp cmp-path cmp-treesitter @@ -355,9 +351,7 @@ in vim-sneak vim-surround ]; - }; - }; home.file.".config/nvim/lua".source = ./nvim/lua; @@ -374,5 +368,4 @@ in 70 80 80 90 ''; - } diff --git a/machines/demeter/configuration.nix b/machines/demeter/configuration.nix index 5ba4ace..a616022 100644 --- a/machines/demeter/configuration.nix +++ b/machines/demeter/configuration.nix @@ -1,11 +1,9 @@ -{ pkgs, ... }: - -{ +{pkgs, ...}: { nixpkgs.config.allowUnfree = true; - environment = { variables = { LANG = "en_US.UTF-8"; }; }; + environment = {variables = {LANG = "en_US.UTF-8";};}; - networking = { hostName = "demeter"; }; + networking = {hostName = "demeter";}; # Auto upgrade nix package and the daemon service. services.nix-daemon.enable = true; diff --git a/machines/hephaestus/configuration.nix b/machines/hephaestus/configuration.nix index 2b64ff7..66c0609 100644 --- a/machines/hephaestus/configuration.nix +++ b/machines/hephaestus/configuration.nix @@ -1,7 +1,9 @@ -{ config, pkgs, ... }: - { - imports = [ ./hardware.nix ]; + config, + pkgs, + ... +}: { + imports = [./hardware.nix]; # Use the systemd-boot EFI boot loader. boot.loader.systemd-boot.enable = true; @@ -14,12 +16,24 @@ hostName = "hephaestus"; interfaces.enp34s0 = { useDHCP = true; - /* ipv4.addresses = [ */ - /* { */ - /* address = "192.168.1.69"; */ - /* prefixLength = 24; */ - /* } */ - /* ]; */ + /* + ipv4.addresses = [ + */ + /* + { + */ + /* + address = "192.168.1.69"; + */ + /* + prefixLength = 24; + */ + /* + } + */ + /* + ]; + */ }; defaultGateway = { address = "192.168.1.2"; @@ -36,9 +50,9 @@ }; services.sshd.enable = true; - services.tailscale = { enable = true; }; + services.tailscale = {enable = true;}; services.xserver = { - videoDrivers = [ "nvidia" ]; + videoDrivers = ["nvidia"]; deviceSection = '' Option "Coolbits" "4" ''; @@ -48,6 +62,4 @@ services.udev.extraRules = '' KERNEL=="hidraw*", SUBSYSTEM=="hidraw", MODE="0666" ''; - } - diff --git a/machines/hephaestus/hardware.nix b/machines/hephaestus/hardware.nix index 44c6eaa..1ebad31 100644 --- a/machines/hephaestus/hardware.nix +++ b/machines/hephaestus/hardware.nix @@ -1,13 +1,16 @@ -{ config, lib, pkgs, modulesPath, ... }: - { - imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; + config, + lib, + pkgs, + modulesPath, + ... +}: { + imports = [(modulesPath + "/installer/scan/not-detected.nix")]; - boot.initrd.availableKernelModules = - [ "nvme" "xhci_pci" "ahci" "usb_storage" "usbhid" "sd_mod" ]; - boot.initrd.kernelModules = [ ]; - boot.kernelModules = [ "kvm-amd" ]; - boot.extraModulePackages = [ config.boot.kernelPackages.v4l2loopback.out ]; + boot.initrd.availableKernelModules = ["nvme" "xhci_pci" "ahci" "usb_storage" "usbhid" "sd_mod"]; + boot.initrd.kernelModules = []; + boot.kernelModules = ["kvm-amd"]; + boot.extraModulePackages = [config.boot.kernelPackages.v4l2loopback.out]; powerManagement.cpuFreqGovernor = "balanced"; @@ -35,13 +38,11 @@ fsType = "vfat"; }; - swapDevices = - [{ device = "/dev/disk/by-uuid/aca92a73-2941-40ca-88c4-0dd8607d232a"; }]; + swapDevices = [{device = "/dev/disk/by-uuid/aca92a73-2941-40ca-88c4-0dd8607d232a";}]; fileSystems."/mnt/storage" = { device = "/dev/disk/by-uuid/0f592fca-1d4e-43f7-9bf4-f1c3e19e841f"; fsType = "ext4"; }; hardware.video.hidpi.enable = lib.mkDefault true; - } diff --git a/modules/darwin/brew.nix b/modules/darwin/brew.nix index 15e4e47..f4ec07a 100644 --- a/modules/darwin/brew.nix +++ b/modules/darwin/brew.nix @@ -1,9 +1,11 @@ -{ config, lib, pkgs, ... }: - -let - checkBrew = "command -v brew > /dev/null"; -in { + config, + lib, + pkgs, + ... +}: let + checkBrew = "command -v brew > /dev/null"; +in { environment = { extraInit = '' ${checkBrew} || >&2 echo "brew is not installed (install it via https://brew.sh)" @@ -48,6 +50,5 @@ in "homebrew/core" "homebrew/services" ]; - }; } diff --git a/modules/darwin/default.nix b/modules/darwin/default.nix index 7a55216..76f4596 100644 --- a/modules/darwin/default.nix +++ b/modules/darwin/default.nix @@ -1,4 +1,4 @@ -{ pkgs, ... }: { +{pkgs, ...}: { imports = [ ./brew.nix ./preferences.nix diff --git a/modules/darwin/preferences.nix b/modules/darwin/preferences.nix index 69b387d..63bf3cd 100644 --- a/modules/darwin/preferences.nix +++ b/modules/darwin/preferences.nix @@ -1,5 +1,8 @@ -{ config, pkgs, ... }: { - +{ + config, + pkgs, + ... +}: { system.defaults = { loginwindow = { GuestEnabled = false; @@ -51,5 +54,4 @@ AppleShowScrollBars = "Automatic"; }; }; - } diff --git a/modules/overlays/aws-connect/default.nix b/modules/overlays/aws-connect/default.nix index 4845c51..00f379d 100644 --- a/modules/overlays/aws-connect/default.nix +++ b/modules/overlays/aws-connect/default.nix @@ -1,5 +1,8 @@ -{ stdenv, lib, fetchFromGitHub }: - +{ + stdenv, + lib, + fetchFromGitHub, +}: stdenv.mkDerivation rec { pname = "aws-connect"; version = "1.0.19"; diff --git a/modules/overlays/aws-role-play/default.nix b/modules/overlays/aws-role-play/default.nix index c041b7f..a5fc4cc 100644 --- a/modules/overlays/aws-role-play/default.nix +++ b/modules/overlays/aws-role-play/default.nix @@ -1,6 +1,8 @@ -{ lib, fetchFromGitHub, python3 }: - -let +{ + lib, + fetchFromGitHub, + python3, +}: let py = python3.override { packageOverrides = self: super: { prettycolors = super.buildPythonPackage rec { @@ -13,41 +15,41 @@ let rev = "8b58260f00b0aab789e940f5ee190fa9c3c10925"; sha256 = "sha256-ICFwaRkQ30/sml4GuzXF8TyJAg+ZXnLmKGil18KisUw="; }; - propagatedBuildInputs = [ py.pkgs.colorama ]; + propagatedBuildInputs = [py.pkgs.colorama]; }; }; }; in -with py.pkgs; -buildPythonApplication rec { - pname = "aws-role-play"; - version = "419e0de612554bfce467da4896e1abcadb78c406"; - format = "pyproject"; + with py.pkgs; + buildPythonApplication rec { + pname = "aws-role-play"; + version = "419e0de612554bfce467da4896e1abcadb78c406"; + format = "pyproject"; - src = fetchFromGitHub { - owner = "rewindio"; - repo = "aws-role-play"; - rev = version; - hash = "sha256-o+u/ixL48J2WMWFRkOlWGvXMVwn+BrofzlspOVwmnCo="; - }; + src = fetchFromGitHub { + owner = "rewindio"; + repo = "aws-role-play"; + rev = version; + hash = "sha256-o+u/ixL48J2WMWFRkOlWGvXMVwn+BrofzlspOVwmnCo="; + }; - # No tests included - doCheck = false; + # No tests included + doCheck = false; - nativeBuildInputs = [ poetry ]; + nativeBuildInputs = [poetry]; - propagatedBuildInputs = with py.pkgs; [ - boto3 - click - colorama - prettycolors - ]; + propagatedBuildInputs = with py.pkgs; [ + boto3 + click + colorama + prettycolors + ]; - passthru.python3 = python3; + passthru.python3 = python3; - meta = with lib; { - homepage = "https://www.rewind.com/"; - description = "A CLI tool that makes assuming IAM roles and exporting temporary credentials easier"; - license = licenses.mit; - }; -} + meta = with lib; { + homepage = "https://www.rewind.com/"; + description = "A CLI tool that makes assuming IAM roles and exporting temporary credentials easier"; + license = licenses.mit; + }; + } diff --git a/modules/overlays/default.nix b/modules/overlays/default.nix index ecd65a6..66190d0 100644 --- a/modules/overlays/default.nix +++ b/modules/overlays/default.nix @@ -1,13 +1,10 @@ final: prev: { - - aws-connect = prev.callPackage ./aws-connect { }; - aws-role-play = prev.callPackage ./aws-role-play { }; - keyleds = prev.callPackage ./keyleds { }; - lpass = prev.callPackage ./lastpass { }; - rfd = prev.callPackage ./rfd { }; - srv = prev.callPackage ./srv { }; - tmux-sessionizer = prev.callPackage ./tmux-sessionizer { }; - vpngate = prev.callPackage ./vpngate { }; - yar = prev.callPackage ./yar { }; - + aws-connect = prev.callPackage ./aws-connect {}; + aws-role-play = prev.callPackage ./aws-role-play {}; + keyleds = prev.callPackage ./keyleds {}; + rfd = prev.callPackage ./rfd {}; + srv = prev.callPackage ./srv {}; + tmux-sessionizer = prev.callPackage ./tmux-sessionizer {}; + vpngate = prev.callPackage ./vpngate {}; + yar = prev.callPackage ./yar {}; } diff --git a/modules/overlays/keyleds/default.nix b/modules/overlays/keyleds/default.nix index 3f10c07..543078b 100644 --- a/modules/overlays/keyleds/default.nix +++ b/modules/overlays/keyleds/default.nix @@ -1,9 +1,9 @@ -{ pkgs -, stdenv -, fetchFromGitHub -, +{ + pkgs, + stdenv, + fetchFromGitHub, + ... }: - stdenv.mkDerivation rec { name = "keyleds"; version = "1.1.1"; @@ -16,6 +16,18 @@ stdenv.mkDerivation rec { sha256 = "sha256-KCWmaRmJTmZgTt7HW9o6Jt1u4x6+G2j6T9EqVt21U18="; }; - nativeBuildInputs = with pkgs; [ cmake pkgconfig ]; - buildInputs = with pkgs; [ xlibsWrapper xorg.libXi libuv systemd luajit libyaml ]; + postInstall = '' + cat <> $out/bin/set-leds.sh + #!/usr/bin/env bash + + for d in \$($out/bin/keyledsctl list); do + $out/bin/keyledsctl set-leds -d \$d all=black|| true; + done + EOF + + chmod +x $out/bin/set-leds.sh + ''; + + nativeBuildInputs = with pkgs; [cmake pkgconfig]; + buildInputs = with pkgs; [xlibsWrapper xorg.libXi libuv systemd luajit libyaml]; } diff --git a/modules/overlays/lastpass/default.nix b/modules/overlays/lastpass/default.nix deleted file mode 100644 index 759e20d..0000000 --- a/modules/overlays/lastpass/default.nix +++ /dev/null @@ -1,46 +0,0 @@ -{ stdenv -, lib -, fetchFromGitHub -, asciidoc -, cmake -, docbook_xsl -, pkgconfig -, bash-completion -, curl -, openssl -, libxml2 -, libxslt -}: - -stdenv.mkDerivation rec { - pname = "lpass"; - version = "1.3.4-unreleased"; - - src = fetchFromGitHub { - owner = "lastpass"; - repo = "lastpass-cli"; - rev = "8767b5e53192ad4e72d1352db4aa9218e928cbe1"; - sha256 = "sha256:1d4m5h9byq5cccdg98m8d8457rbvp28q821d8rpglykgrfgnknwp"; - }; - - nativeBuildInputs = [ asciidoc cmake docbook_xsl pkgconfig ]; - - buildInputs = [ bash-completion curl openssl libxml2 libxslt ]; - - enableParallelBuilding = true; - - installTargets = [ "install" "install-doc" ]; - - postInstall = '' - install -Dm644 -T ../contrib/lpass_zsh_completion $out/share/zsh/site-functions/_lpass - install -Dm644 -T ../contrib/completions-lpass.fish $out/share/fish/vendor_completions.d/lpass.fish - ''; - - meta = with lib; { - description = - "Stores, retrieves, generates, and synchronizes passwords securely"; - homepage = "https://github.com/lastpass/lastpass-cli"; - license = licenses.gpl2Plus; - platforms = platforms.unix; - }; -} diff --git a/modules/overlays/rfd/default.nix b/modules/overlays/rfd/default.nix index 01ae3c9..06e3f3b 100644 --- a/modules/overlays/rfd/default.nix +++ b/modules/overlays/rfd/default.nix @@ -1,39 +1,41 @@ -{ lib, fetchFromGitHub, python3 }: - -let py = python3.override { }; - +{ + lib, + fetchFromGitHub, + python3, +}: let + py = python3.override {}; in -with py.pkgs; -buildPythonApplication rec { - pname = "rfd"; - version = "v0.8.1"; - format = "pyproject"; + with py.pkgs; + buildPythonApplication rec { + pname = "rfd"; + version = "v0.8.1"; + format = "pyproject"; - src = fetchFromGitHub { - owner = "davegallant"; - repo = "rfd"; - rev = version; - hash = "sha256-9gOxrKVEqbg2vLO5opoetVSxgwpm/3SV60mK8Le6F48="; - }; + src = fetchFromGitHub { + owner = "davegallant"; + repo = "rfd"; + rev = version; + hash = "sha256-9gOxrKVEqbg2vLO5opoetVSxgwpm/3SV60mK8Le6F48="; + }; - # No tests included - doCheck = false; + # No tests included + doCheck = false; - nativeBuildInputs = [ poetry ]; + nativeBuildInputs = [poetry]; - propagatedBuildInputs = with py.pkgs; [ - beautifulsoup4 - click - colorama - requests - soupsieve - ]; + propagatedBuildInputs = with py.pkgs; [ + beautifulsoup4 + click + colorama + requests + soupsieve + ]; - passthru.python3 = python3; + passthru.python3 = python3; - meta = with lib; { - homepage = "https://www.redflagdeals.com/"; - description = "View RedFlagDeals from the command line"; - license = licenses.gpl3; - }; -} + meta = with lib; { + homepage = "https://www.redflagdeals.com/"; + description = "View RedFlagDeals from the command line"; + license = licenses.gpl3; + }; + } diff --git a/modules/overlays/srv/default.nix b/modules/overlays/srv/default.nix index 82ed3f9..89c7536 100644 --- a/modules/overlays/srv/default.nix +++ b/modules/overlays/srv/default.nix @@ -1,5 +1,8 @@ -{ lib, fetchFromGitHub, buildGoModule }: - +{ + lib, + fetchFromGitHub, + buildGoModule, +}: buildGoModule rec { pname = "srv"; version = "v0.1.2"; @@ -16,7 +19,7 @@ buildGoModule rec { meta = with lib; { description = "a simple rss viewer"; license = licenses.gpl3; - maintainers = with maintainers; [ davegallant ]; + maintainers = with maintainers; [davegallant]; platforms = platforms.linux ++ platforms.darwin; }; } diff --git a/modules/overlays/tmux-sessionizer/default.nix b/modules/overlays/tmux-sessionizer/default.nix index 3a69d11..385295a 100644 --- a/modules/overlays/tmux-sessionizer/default.nix +++ b/modules/overlays/tmux-sessionizer/default.nix @@ -1,12 +1,15 @@ -{ stdenv, lib, fetchurl }: - +{ + stdenv, + lib, + fetchurl, +}: stdenv.mkDerivation rec { pname = "tmux-sessionizer"; version = "0.0.0"; executable = ./tmux-sessionizer; - phases = [ "unpackPhase" ]; # Remove all other phases + phases = ["unpackPhase"]; # Remove all other phases unpackPhase = '' mkdir -p $out/bin @@ -19,4 +22,3 @@ stdenv.mkDerivation rec { platforms = platforms.unix; }; } - diff --git a/modules/overlays/vpngate/default.nix b/modules/overlays/vpngate/default.nix index 55f53e9..059a8ed 100644 --- a/modules/overlays/vpngate/default.nix +++ b/modules/overlays/vpngate/default.nix @@ -1,7 +1,9 @@ -{ lib, fetchFromGitHub, buildGoModule }: - +{ + lib, + fetchFromGitHub, + buildGoModule, +}: buildGoModule rec { - pname = "vpngate"; version = "v0.1.1"; @@ -18,7 +20,7 @@ buildGoModule rec { homepage = "https://www.vpngate.net"; description = "a client for vpngate.net"; license = licenses.gpl3; - maintainers = with maintainers; [ davegallant ]; + maintainers = with maintainers; [davegallant]; platforms = platforms.linux ++ platforms.darwin; }; } diff --git a/modules/overlays/yar/default.nix b/modules/overlays/yar/default.nix index 5b8b2f7..9099ca3 100644 --- a/modules/overlays/yar/default.nix +++ b/modules/overlays/yar/default.nix @@ -1,5 +1,8 @@ -{ lib, fetchFromGitHub, buildGoModule }: - +{ + lib, + fetchFromGitHub, + buildGoModule, +}: buildGoModule rec { pname = "yar"; version = "master"; @@ -16,7 +19,7 @@ buildGoModule rec { meta = with lib; { description = "Yar is a tool for plunderin' organizations, users and/or repositories."; license = licenses.gpl3; - maintainers = with maintainers; [ davegallant ]; + maintainers = with maintainers; [davegallant]; platforms = platforms.linux ++ platforms.darwin; }; } diff --git a/services/keyleds/default.nix b/services/keyleds/default.nix new file mode 100644 index 0000000..7cc1e2c --- /dev/null +++ b/services/keyleds/default.nix @@ -0,0 +1,15 @@ +{ + config, + pkgs, + ... +}: let +in { + systemd.services.keyleds = { + description = "Logitech Keyboard animation for Linux — G410, G513, G610, G810, G910, GPro"; + wantedBy = ["multi-user.target"]; + + serviceConfig = { + ExecStart = "${pkgs.keyleds}/bin/set-leds.sh"; + }; + }; +} diff --git a/common/netdata/default.nix b/services/netdata/default.nix similarity index 90% rename from common/netdata/default.nix rename to services/netdata/default.nix index 1e179b9..b322274 100644 --- a/common/netdata/default.nix +++ b/services/netdata/default.nix @@ -1,10 +1,12 @@ -{ config, pkgs, ... }: -let +{ + config, + pkgs, + ... +}: let netdata = pkgs.netdata; netdataConf = ./netdata.conf; netdataDir = "/var/lib/netdata"; -in -{ +in { users.extraGroups.netdata.gid = 220008; users.users.netdata.group = "netdata"; users.extraUsers.netdata = { @@ -14,8 +16,8 @@ in uid = 200008; }; systemd.services.netdata = { - wantedBy = [ "multi-user.target" ]; - after = [ "network.target" ]; + wantedBy = ["multi-user.target"]; + after = ["network.target"]; preStart = '' mkdir -p ${netdataDir}/config mkdir -p ${netdataDir}/logs @@ -40,5 +42,4 @@ in } } ''; - } diff --git a/common/netdata/netdata.conf b/services/netdata/netdata.conf similarity index 100% rename from common/netdata/netdata.conf rename to services/netdata/netdata.conf diff --git a/shell.nix b/shell.nix index 8aa1f75..7df0495 100644 --- a/shell.nix +++ b/shell.nix @@ -1,4 +1,4 @@ -(import { }).mkShell { +(import {}).mkShell { shellHook = '' ${(import ./default.nix).pre-commit-check.shellHook} '';