From 369c3399b50fb79285cdb3150d79bcd86c2b8537 Mon Sep 17 00:00:00 2001 From: "Casper V. Kristensen" Date: Tue, 1 Aug 2023 16:55:53 +0200 Subject: [PATCH] nix fmt --- flake.nix | 11 +++++++---- home/default.nix | 1 + hosts/omega/default.nix | 4 ++-- hosts/omega/hardware.nix | 13 +++++++------ hosts/zeta/default.nix | 4 ++-- hosts/zeta/hardware.nix | 13 +++++++------ modules/base/impermanence.nix | 6 +++--- modules/base/ssh.nix | 12 ++++++------ modules/base/users.nix | 6 +++--- modules/desktop/sway.nix | 8 ++++---- 10 files changed, 42 insertions(+), 36 deletions(-) diff --git a/flake.nix b/flake.nix index dee2023..6fad95a 100644 --- a/flake.nix +++ b/flake.nix @@ -10,20 +10,23 @@ }; nix-index-database = { url = "github:nix-community/nix-index-database"; - inputs.nixpkgs.follows = "nixpkgs"; # use the same nixpkgs as the system + inputs.nixpkgs.follows = "nixpkgs"; # use the same nixpkgs as the system }; home-manager = { url = "github:nix-community/home-manager/release-23.05"; - inputs.nixpkgs.follows = "nixpkgs"; # use the same nixpkgs as the system + inputs.nixpkgs.follows = "nixpkgs"; # use the same nixpkgs as the system }; }; outputs = { self, nixpkgs, ... }@inputs: { + # https://nixos.org/manual/nix/stable/command-ref/new-cli/nix3-fmt.html + formatter.x86_64-linux = nixpkgs.legacyPackages.x86_64-linux.nixpkgs-fmt; + nixosConfigurations = { # Home desktop omega = nixpkgs.lib.nixosSystem { system = "x86_64-linux"; - specialArgs = inputs; # pass flake inputs to modules + specialArgs = inputs; # pass flake inputs to modules modules = [ ./hosts/omega ]; @@ -31,7 +34,7 @@ # Laptop zeta = nixpkgs.lib.nixosSystem { system = "x86_64-linux"; - specialArgs = inputs; # pass flake inputs to modules + specialArgs = inputs; # pass flake inputs to modules modules = [ ./hosts/zeta ]; diff --git a/home/default.nix b/home/default.nix index e69de29..8b13789 100644 --- a/home/default.nix +++ b/home/default.nix @@ -0,0 +1 @@ + diff --git a/hosts/omega/default.nix b/hosts/omega/default.nix index 7390a60..533c537 100644 --- a/hosts/omega/default.nix +++ b/hosts/omega/default.nix @@ -23,7 +23,7 @@ # this value at the release version of the first install of this system. # Before changing this value read the documentation for this option # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). - system.stateVersion = "23.05"; # Did you read the comment? + system.stateVersion = "23.05"; # Did you read the comment? # This value determines the Home Manager release that your # configuration is compatible with. This helps avoid breakage @@ -32,5 +32,5 @@ # You can update Home Manager without changing this value. See # the Home Manager release notes for a list of state version # changes in each release. - home-manager.users.caspervk.home.stateVersion = "23.05"; # Did you read the comment? + home-manager.users.caspervk.home.stateVersion = "23.05"; # Did you read the comment? } diff --git a/hosts/omega/hardware.nix b/hosts/omega/hardware.nix index 452f4e9..dd91caf 100644 --- a/hosts/omega/hardware.nix +++ b/hosts/omega/hardware.nix @@ -2,7 +2,8 @@ { imports = - [ (modulesPath + "/profiles/qemu-guest.nix") + [ + (modulesPath + "/profiles/qemu-guest.nix") ]; boot.initrd.availableKernelModules = [ "ahci" "xhci_pci" "virtio_pci" "sr_mod" "virtio_blk" ]; @@ -14,7 +15,7 @@ fileSystems."/" = { device = "none"; fsType = "tmpfs"; - options = [ "defaults" "size=2G" "mode=755" ]; # mode=755 so only root can write to those files + options = [ "defaults" "size=2G" "mode=755" ]; # mode=755 so only root can write to those files }; fileSystems."/boot" = { device = "/dev/disk/by-label/BOOT"; @@ -26,10 +27,10 @@ }; swapDevices = [ - { - device = "/nix/persist/swapfile"; - size = 16*1024; # 16 GiB - } + { + device = "/nix/persist/swapfile"; + size = 16 * 1024; # 16 GiB + } ]; # Enables DHCP on each ethernet and wireless interface. In case of scripted networking diff --git a/hosts/zeta/default.nix b/hosts/zeta/default.nix index 6ba470b..ce4110d 100644 --- a/hosts/zeta/default.nix +++ b/hosts/zeta/default.nix @@ -23,7 +23,7 @@ # this value at the release version of the first install of this system. # Before changing this value read the documentation for this option # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). - system.stateVersion = "23.05"; # Did you read the comment? + system.stateVersion = "23.05"; # Did you read the comment? # This value determines the Home Manager release that your # configuration is compatible with. This helps avoid breakage @@ -32,5 +32,5 @@ # You can update Home Manager without changing this value. See # the Home Manager release notes for a list of state version # changes in each release. - home-manager.users.caspervk.home.stateVersion = "23.05"; # Did you read the comment? + home-manager.users.caspervk.home.stateVersion = "23.05"; # Did you read the comment? } diff --git a/hosts/zeta/hardware.nix b/hosts/zeta/hardware.nix index a43bcb5..5d3db63 100644 --- a/hosts/zeta/hardware.nix +++ b/hosts/zeta/hardware.nix @@ -2,7 +2,8 @@ { imports = - [ (modulesPath + "/installer/scan/not-detected.nix") + [ + (modulesPath + "/installer/scan/not-detected.nix") ]; boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "usb_storage" "sd_mod" ]; @@ -14,7 +15,7 @@ fileSystems."/" = { device = "none"; fsType = "tmpfs"; - options = [ "defaults" "size=2G" "mode=755" ]; # mode=755 so only root can write to those files + options = [ "defaults" "size=2G" "mode=755" ]; # mode=755 so only root can write to those files }; fileSystems."/boot" = { device = "/dev/disk/by-label/BOOT"; @@ -26,10 +27,10 @@ }; swapDevices = [ - { - device = "/nix/persist/swapfile"; - size = 8*1024; # 8 GiB - } + { + device = "/nix/persist/swapfile"; + size = 8 * 1024; # 8 GiB + } ]; # Enables DHCP on each ethernet and wireless interface. In case of scripted networking diff --git a/modules/base/impermanence.nix b/modules/base/impermanence.nix index c5b0a60..822bcae 100644 --- a/modules/base/impermanence.nix +++ b/modules/base/impermanence.nix @@ -16,17 +16,17 @@ hideMounts = true; directories = [ { directory = "/etc/NetworkManager/system-connections"; user = "root"; group = "root"; mode = "0700"; } - { directory = "/tmp"; user = "root"; group = "root"; mode = "1777"; } # see comment above + { directory = "/tmp"; user = "root"; group = "root"; mode = "1777"; } # see comment above # With great power comes great responsibility, we get it { directory = "/var/db/sudo/lectured"; user = "root"; group = "root"; mode = "0700"; } { directory = "/var/log"; user = "root"; group = "root"; mode = "0755"; } ]; files = [ - "/etc/machine-id" # needed for /var/log + "/etc/machine-id" # needed for /var/log ]; users.caspervk = { directories = [ - "/" # entire home directory + "/" # entire home directory ]; }; }; diff --git a/modules/base/ssh.nix b/modules/base/ssh.nix index 1832e24..c963594 100644 --- a/modules/base/ssh.nix +++ b/modules/base/ssh.nix @@ -8,11 +8,11 @@ }; environment.persistence."/nix/persist" = { - files = [ - "/etc/ssh/ssh_host_ed25519_key" - "/etc/ssh/ssh_host_ed25519_key.pub" - "/etc/ssh/ssh_host_rsa_key" - "/etc/ssh/ssh_host_rsa_key.pub" - ]; + files = [ + "/etc/ssh/ssh_host_ed25519_key" + "/etc/ssh/ssh_host_ed25519_key.pub" + "/etc/ssh/ssh_host_rsa_key" + "/etc/ssh/ssh_host_rsa_key.pub" + ]; }; } diff --git a/modules/base/users.nix b/modules/base/users.nix index c9c7585..7c7614b 100644 --- a/modules/base/users.nix +++ b/modules/base/users.nix @@ -12,8 +12,8 @@ passwordFile = "/nix/persist/passwordfile"; extraGroups = [ "networkmanager" - "wheel" # allows sudo - "video" # allows controlling brightness + "wheel" # allows sudo + "video" # allows controlling brightness # todo: docker, systemd-journal, audio, input, power, nix ? ]; uid = 1000; @@ -21,7 +21,7 @@ "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPB/qr63FB0ZqOe/iZGwIKNHD8a1Ud/mXVjQPmpIG7pM caspervk@omega" "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAII71DKQziktCkyMAmL25QKRK6nG2uJDkQXioIZp5JkMZ caspervk@zeta" ]; - packages = with pkgs; []; + packages = with pkgs; [ ]; }; }; }; diff --git a/modules/desktop/sway.nix b/modules/desktop/sway.nix index 7cc57d2..cc5ed59 100644 --- a/modules/desktop/sway.nix +++ b/modules/desktop/sway.nix @@ -18,10 +18,10 @@ # Trackpad tap = "enabled"; natural_scroll = "enable"; - dwt = "disabled"; # don't disable-while-typing + dwt = "disabled"; # don't disable-while-typing }; }; - modifier = "Mod4"; # super + modifier = "Mod4"; # super terminal = "alacritty"; workspaceAutoBackAndForth = true; }; @@ -44,7 +44,7 @@ }; # Video - programs.light.enable = true; # allows controlling screen brightness + programs.light.enable = true; # allows controlling screen brightness # Allow sharing screen #xdg.portal.wlr.enable = true; @@ -53,6 +53,6 @@ hardware.opengl = { enable = true; - extraPackages = with pkgs; [intel-media-driver ]; + extraPackages = with pkgs; [ intel-media-driver ]; }; }