From d45a4f23587ef0e5710fa25b0e5bbb53188358c8 Mon Sep 17 00:00:00 2001 From: cy Date: Mon, 9 Dec 2024 02:14:11 -0500 Subject: [PATCH] nix fmt --- nix/anki-bin.nix | 24 +++++++-------- nix/configuration.nix | 30 +++++++++---------- nix/flake.nix | 39 ++++++++++++------------ nix/hardware-configuration.nix | 19 +++++++----- nix/singlefile.nix | 54 ---------------------------------- 5 files changed, 60 insertions(+), 106 deletions(-) delete mode 100644 nix/singlefile.nix diff --git a/nix/anki-bin.nix b/nix/anki-bin.nix index 02e4272..01cc31e 100644 --- a/nix/anki-bin.nix +++ b/nix/anki-bin.nix @@ -1,15 +1,15 @@ -{ - fetchurl, - stdenv, - lib, - buildFHSEnv, - appimageTools, - writeShellScript, - anki, - undmg, - zstd, - cacert, - commandLineArgs ? [ ], +{ fetchurl +, stdenv +, lib +, buildFHSEnv +, appimageTools +, writeShellScript +, anki +, undmg +, zstd +, cacert +, commandLineArgs ? [ ] +, }: let diff --git a/nix/configuration.nix b/nix/configuration.nix index 35f3bb0..00b832c 100644 --- a/nix/configuration.nix +++ b/nix/configuration.nix @@ -106,8 +106,8 @@ btop stockfish cutechess - grim - slurp + grim + slurp rofi-wayland rofimoji cliphist @@ -147,7 +147,7 @@ nextcloud-client python312Packages.python-lsp-server - (callPackage ./anki-bin.nix {}) + (callPackage ./anki-bin.nix { }) ]; }; @@ -156,10 +156,10 @@ vim wget neovim - git - python3 - wl-clipboard - mako + git + python3 + wl-clipboard + mako tree kitty borgbackup @@ -252,12 +252,12 @@ # warnings are often not that serious failOnWarnings = false; postHook = '' - ${pkgs.curl}/bin/curl -u $(cat /run/secrets/ntfy) -d "ytnixRsync: backup completed with exit code: $exitStatus - $(journalctl -u borgbackup-job-ytnixRsync.service|tail -n 5)" \ - https://ntfy.cything.io/chunk - ''; + ${pkgs.curl}/bin/curl -u $(cat /run/secrets/ntfy) -d "ytnixRsync: backup completed with exit code: $exitStatus + $(journalctl -u borgbackup-job-ytnixRsync.service|tail -n 5)" \ + https://ntfy.cything.io/chunk + ''; }; - + services.btrbk.instances.local = { onCalendar = "hourly"; settings = { @@ -265,8 +265,8 @@ snapshot_preserve_min = "2d"; snapshot_dir = "/snapshots"; subvolume = { - "/home" = {}; - "/" = {}; + "/home" = { }; + "/" = { }; }; }; }; @@ -297,7 +297,7 @@ # mount, trash and stuff in thunar services.gvfs.enable = true; # thumbnails in thunar - services.tumbler.enable =true; + services.tumbler.enable = true; virtualisation = { libvirtd.enable = true; diff --git a/nix/flake.nix b/nix/flake.nix index 913b643..be0ed91 100644 --- a/nix/flake.nix +++ b/nix/flake.nix @@ -14,24 +14,27 @@ }; outputs = { self, nixpkgs, sops-nix, home-manager, ... }@inputs: - let - lib = nixpkgs.lib; - in { - nixosConfigurations = { - ytnix = lib.nixosSystem { - specialArgs = { inherit inputs; }; - modules = [ - ./configuration.nix - sops-nix.nixosModules.sops - home-manager.nixosModules.home-manager { - home-manager = { - useGlobalPkgs = true; - useUserPackages = true; - users.yt = import ./home.nix; - }; - } - ]; + let + lib = nixpkgs.lib; + in + { + nixosConfigurations = { + ytnix = lib.nixosSystem { + specialArgs = { inherit inputs; }; + modules = [ + ./configuration.nix + sops-nix.nixosModules.sops + home-manager.nixosModules.home-manager + { + home-manager = { + useGlobalPkgs = true; + useUserPackages = true; + users.yt = import ./home.nix; + }; + } + ]; + }; }; + formatter.x86_64-linux = nixpkgs.legacyPackages.x86_64-linux.nixpkgs-fmt; }; - }; } diff --git a/nix/hardware-configuration.nix b/nix/hardware-configuration.nix index 60d0719..1b21813 100644 --- a/nix/hardware-configuration.nix +++ b/nix/hardware-configuration.nix @@ -10,7 +10,8 @@ boot.extraModulePackages = [ ]; fileSystems."/" = - { device = "/dev/disk/by-uuid/17870658-6118-46af-837f-70c9175e09c3"; + { + device = "/dev/disk/by-uuid/17870658-6118-46af-837f-70c9175e09c3"; fsType = "btrfs"; options = [ "subvol=root" "compress=zstd" ]; }; @@ -18,32 +19,36 @@ boot.initrd.luks.devices."cryptroot".device = "/dev/disk/by-uuid/c6098a16-c8a6-4a97-8648-6f46ca919d13"; fileSystems."/home" = - { device = "/dev/disk/by-uuid/17870658-6118-46af-837f-70c9175e09c3"; + { + device = "/dev/disk/by-uuid/17870658-6118-46af-837f-70c9175e09c3"; fsType = "btrfs"; options = [ "subvol=home" "compress=zstd" ]; }; fileSystems."/nix" = - { device = "/dev/disk/by-uuid/17870658-6118-46af-837f-70c9175e09c3"; + { + device = "/dev/disk/by-uuid/17870658-6118-46af-837f-70c9175e09c3"; fsType = "btrfs"; options = [ "subvol=nix" "compress=zstd" "noatime" ]; }; fileSystems."/swap" = - { device = "/dev/disk/by-uuid/17870658-6118-46af-837f-70c9175e09c3"; + { + device = "/dev/disk/by-uuid/17870658-6118-46af-837f-70c9175e09c3"; fsType = "btrfs"; options = [ "subvol=swap" ]; }; fileSystems."/boot" = - { device = "/dev/disk/by-uuid/29B7-F46D"; + { + device = "/dev/disk/by-uuid/29B7-F46D"; fsType = "vfat"; options = [ "fmask=0022" "dmask=0022" ]; }; - swapDevices = [ { + swapDevices = [{ device = "/swap/swapfile"; - } ]; + }]; boot.resumeDevice = "/dev/disk/by-uuid/17870658-6118-46af-837f-70c9175e09c3"; boot.kernelParams = [ "resume_offset=53224704" ]; diff --git a/nix/singlefile.nix b/nix/singlefile.nix deleted file mode 100644 index 817a255..0000000 --- a/nix/singlefile.nix +++ /dev/null @@ -1,54 +0,0 @@ -{ - lib, - stdenv, - buildNpmPackage, - fetchFromGitHub, - chromium, - python3, -}: -buildNpmPackage { - pname = "single-file-cli"; - version = "2.0.73"; - - src = fetchFromGitHub { - owner = "gildas-lormeau"; - repo = "single-file-cli"; - rev = "0b87ca9167f6cb2b036770d38e9b6bbfaf47abc5"; - hash = "sha256-fMedP+wp1crHUj9/MVyG8XSsl1PA5bp7/HL4k+X0TRg="; - }; - npmDepsHash = "sha256-nnOMBb9mHNhDejE3+Kl26jsrTRxSSg500q1iwwVUqP8="; - - nativeCheckInputs = [chromium]; - doCheck = stdenv.hostPlatform.isLinux; - - postBuild = '' - patchShebangs ./single-file - ''; - - checkPhase = '' - runHook preCheck - - ${python3}/bin/python -m http.server --bind 127.0.0.1 & - pid=$! - - ./single-file \ - --browser-headless \ - --browser-executable-path chromium-browser\ - http://127.0.0.1:8000 - - grep -F 'Page saved with SingleFile' 'Directory listing for'*.html - - kill $pid - wait - - runHook postCheck - ''; - - meta = { - description = "CLI tool for saving a faithful copy of a complete web page in a single HTML file"; - homepage = "https://github.com/gildas-lormeau/single-file-cli"; - license = lib.licenses.agpl3Only; - maintainers = with lib.maintainers; [n8henrie]; - mainProgram = "single-file"; - }; -}