From 7dd55a5de9f71d526b0f4cc8088995ebed51887d Mon Sep 17 00:00:00 2001 From: Ryan Yin Date: Sat, 23 Dec 2023 21:39:51 +0800 Subject: [PATCH] chore: nix fmt --- home/linux/desktop/base/misc.nix | 6 +----- modules/darwin/nix-core.nix | 15 +++++++-------- modules/nixos/base/misc.nix | 13 ++++++------- modules/nixos/base/networking.nix | 2 -- modules/nixos/base/user-group.nix | 6 +++++- modules/nixos/desktop/security.nix | 3 +-- systems/default.nix | 2 +- 7 files changed, 21 insertions(+), 26 deletions(-) diff --git a/home/linux/desktop/base/misc.nix b/home/linux/desktop/base/misc.nix index 42b6b6f9..6fab8d52 100644 --- a/home/linux/desktop/base/misc.nix +++ b/home/linux/desktop/base/misc.nix @@ -1,8 +1,4 @@ -{ - pkgs, - ... -}: { - +{pkgs, ...}: { home.packages = with pkgs; [ # GUI apps # e-book viewer(.epub/.mobi/...) diff --git a/modules/darwin/nix-core.nix b/modules/darwin/nix-core.nix index 637ecb50..1f9b43a7 100644 --- a/modules/darwin/nix-core.nix +++ b/modules/darwin/nix-core.nix @@ -11,20 +11,19 @@ # Fix: https://github.com/LnL7/nix-darwin/issues/149#issuecomment-1741720259 # nix is installed via DeterminateSystems's nix-installer. environment.etc."zshrc".knownSha256Hashes = [ - "b9902f2020c636aeda956a74b5ae11882d53e206d1aa50b3abe591a8144fa710" # nix-installer on harmonica + "b9902f2020c636aeda956a74b5ae11882d53e206d1aa50b3abe591a8144fa710" # nix-installer on harmonica ]; environment.etc."bashrc".knownSha256Hashes = [ - "53ab77cddb5c9aa2954efe42e9af0b8a2829f94dd31b6c33f8082ed194dcc0cb" # nix-installer on harmonica - "6ffdf5a198ffe73fbcd17def767f52093b42b29149d4a3e911b49ebcb9785101" # nix-installer on fern - ]; + "53ab77cddb5c9aa2954efe42e9af0b8a2829f94dd31b6c33f8082ed194dcc0cb" # nix-installer on harmonica + "6ffdf5a198ffe73fbcd17def767f52093b42b29149d4a3e911b49ebcb9785101" # nix-installer on fern + ]; environment.etc."zshenv".knownSha256Hashes = [ - "bb96fe80a72ea9cd3291f09e4dc13a64e7db3b401f5889e43edc1fe34ed02d2c" # nix-installer on harmonica - "0c544e42afe7836de9ba933d93f46043b12f58ae484ff8cfb02716353f1dba5f" # nix-installer on fern + "bb96fe80a72ea9cd3291f09e4dc13a64e7db3b401f5889e43edc1fe34ed02d2c" # nix-installer on harmonica + "0c544e42afe7836de9ba933d93f46043b12f58ae484ff8cfb02716353f1dba5f" # nix-installer on fern ]; - environment.etc."shells".knownSha256Hashes = [ - "9d5aa72f807091b481820d12e693093293ba33c73854909ad7b0fb192c2db193" # nix-installer on fern + "9d5aa72f807091b481820d12e693093293ba33c73854909ad7b0fb192c2db193" # nix-installer on fern ]; # Allow unfree packages diff --git a/modules/nixos/base/misc.nix b/modules/nixos/base/misc.nix index df6f0783..9434236e 100644 --- a/modules/nixos/base/misc.nix +++ b/modules/nixos/base/misc.nix @@ -2,8 +2,7 @@ lib, pkgs, ... -}: -{ +}: { ################################################################################### # # NixOS's core configuration suitable for all my machines @@ -28,20 +27,20 @@ nix.settings.auto-optimise-store = true; # Enable in-memory compressed devices and swap space provided by the zram kernel module. - # By enable this, we can store more data in memory instead of fallback to disk-based swap devices directly, + # By enable this, we can store more data in memory instead of fallback to disk-based swap devices directly, # and thus improve I/O performance when we have a lot of memory. - # + # # https://www.kernel.org/doc/Documentation/blockdev/zram.txt zramSwap = { enable = true; # one of "lzo", "lz4", "zstd" algorithm = "zstd"; - # Priority of the zram swap devices. + # Priority of the zram swap devices. # It should be a number higher than the priority of your disk-based swap devices # (so that the system will fill the zram swap devices before falling back to disk swap). priority = 5; - # Maximum total amount of memory that can be stored in the zram swap devices (as a percentage of your total memory). - # Defaults to 1/2 of your total RAM. Run zramctl to check how good memory is compressed. + # Maximum total amount of memory that can be stored in the zram swap devices (as a percentage of your total memory). + # Defaults to 1/2 of your total RAM. Run zramctl to check how good memory is compressed. # This doesn’t define how much memory will be used by the zram swap devices. memoryPercent = 50; }; diff --git a/modules/nixos/base/networking.nix b/modules/nixos/base/networking.nix index 0390a202..361e7348 100644 --- a/modules/nixos/base/networking.nix +++ b/modules/nixos/base/networking.nix @@ -14,6 +14,4 @@ }; openFirewall = true; }; - - } diff --git a/modules/nixos/base/user-group.nix b/modules/nixos/base/user-group.nix index e105c1f1..76f76375 100644 --- a/modules/nixos/base/user-group.nix +++ b/modules/nixos/base/user-group.nix @@ -1,4 +1,8 @@ -{username, config, ...}: { +{ + username, + config, + ... +}: { # Don't allow mutation of users outside the config. users.mutableUsers = false; diff --git a/modules/nixos/desktop/security.nix b/modules/nixos/desktop/security.nix index 1b206197..9083db4f 100644 --- a/modules/nixos/desktop/security.nix +++ b/modules/nixos/desktop/security.nix @@ -1,5 +1,4 @@ -{ config, ...}: -{ +{config, ...}: { nix.extraOptions = '' !include ${config.age.secrets.nix-access-tokens.path} ''; diff --git a/systems/default.nix b/systems/default.nix index d937da33..f02fd605 100644 --- a/systems/default.nix +++ b/systems/default.nix @@ -4,7 +4,7 @@ constants, }: let inherit (inputs.nixpkgs) lib; - mylib = import ../lib { inherit lib; }; + mylib = import ../lib {inherit lib;}; vars = import ./vars.nix; specialArgsForSystem = system: