Skip to content

Commit

Permalink
Reformat using nixfmt-rfc-style
Browse files Browse the repository at this point in the history
  • Loading branch information
alapshin committed Aug 21, 2024
1 parent 2e1b967 commit 4099f53
Show file tree
Hide file tree
Showing 103 changed files with 1,110 additions and 1,022 deletions.
18 changes: 10 additions & 8 deletions configuration.nix
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
{ self
, lib
, pkgs
, config
, inputs
, outputs
, ...
}: {
{
self,
lib,
pkgs,
config,
inputs,
outputs,
...
}:
{
nix = {
gc = {
automatic = true;
Expand Down
92 changes: 44 additions & 48 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,16 @@
};

outputs =
inputs @ { self
, nixos
, nixpkgs
, nur
, disko
, sops-nix
, lanzaboote
, home-manager
, ...
inputs@{
self,
nixos,
nixpkgs,
nur,
disko,
sops-nix,
lanzaboote,
home-manager,
...
}:
let
inherit (nixos) lib;
Expand All @@ -68,8 +69,9 @@
};

mkPkgs =
{ pkgs
, extraOverlays ? [ nur.overlay ]
{
pkgs,
extraOverlays ? [ nur.overlay ],
}:
import pkgs {
inherit system;
Expand All @@ -78,39 +80,43 @@
};
pkgs = mkPkgs { pkgs = nixos; };

homeManagerConfig = {
# Use global pkgs configured via nixpkgs.* options
home-manager.useGlobalPkgs = true;
# Install user packages to /etc/profiles instead.
# Necessary for nixos-rebuild build-vm to work.
home-manager.useUserPackages = true;
home-manager.extraSpecialArgs = {
inherit dotfileDir;
};
home-manager.sharedModules = [
sops-nix.homeManagerModules.sops
];
};
mkNixosConfiguration =
{ system ? "x86_64-linux"
, baseModules ? [
{
system ? "x86_64-linux",
baseModules ? [
./configuration.nix

disko.nixosModules.disko
sops-nix.nixosModules.sops
lanzaboote.nixosModules.lanzaboote
home-manager.nixosModules.home-manager homeManagerConfig
]
, hostModules ? [ ]
, userModules ? [ ]
, specialArgs ? { }
,
home-manager.nixosModules.home-manager
{
# Use global pkgs configured via nixpkgs.* options
home-manager.useGlobalPkgs = true;
# Install user packages to /etc/profiles instead.
# Necessary for nixos-rebuild build-vm to work.
home-manager.useUserPackages = true;
home-manager.extraSpecialArgs = {
inherit dotfileDir;
};
home-manager.sharedModules = [ sops-nix.homeManagerModules.sops ];
}
],
hostModules ? [ ],
userModules ? [ ],
specialArgs ? { },
}:
nixos.lib.nixosSystem {
inherit system;
modules = baseModules ++ hostModules ++ userModules;
specialArgs = specialArgs // {
inherit inputs pkgs self libutil dotfileDir;
inherit
inputs
pkgs
self
libutil
dotfileDir
;
};
};
in
Expand All @@ -127,7 +133,7 @@
};
};
formatter = {
${system} = pkgs.nixpkgs-fmt;
${system} = pkgs.nixfmt-rfc-style;
};

# Reusable nixos modules you might want to export
Expand All @@ -140,16 +146,10 @@
./hosts/common
./hosts/carbon
];
userModules = [
./users/alapshin
];
userModules = [ ./users/alapshin ];
};

bifrost = mkNixosConfiguration {
hostModules = [
./hosts/bifrost
];
};
bifrost = mkNixosConfiguration { hostModules = [ ./hosts/bifrost ]; };

niflheim = mkNixosConfiguration {
hostModules = [
Expand All @@ -164,19 +164,15 @@
./hosts/common
./hosts/desktop
];
userModules = [
./users/alapshin
];
userModules = [ ./users/alapshin ];
};

altdesk = mkNixosConfiguration {
hostModules = [
./hosts/common
./hosts/altdesk
];
userModules = [
./users/alapshin
];
userModules = [ ./users/alapshin ];
};
};
# Stand-alone home-manager configuration for non NixOS machines
Expand Down
6 changes: 2 additions & 4 deletions hosts/altdesk/bluetooth.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
{ config
, pkgs
, ...
}: {
{ config, pkgs, ... }:
{
hardware = {
bluetooth = {
enable = true;
Expand Down
12 changes: 7 additions & 5 deletions hosts/altdesk/default.nix
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
{ lib
, pkgs
, config
, ...
}: {
{
lib,
pkgs,
config,
...
}:
{
imports = [
./backup.nix
./bluetooth.nix
Expand Down
16 changes: 8 additions & 8 deletions hosts/altdesk/graphical-desktop.nix
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
{ lib
, pkgs
, config
, ...
}: {
{
lib,
pkgs,
config,
...
}:
{
services = {
colord.enable = true;
flatpak.enable = true;
Expand All @@ -22,9 +24,7 @@
options = "grp:caps_toggle,compose:ralt";
};

videoDrivers = [
"nvidia"
];
videoDrivers = [ "nvidia" ];
};
};

Expand Down
27 changes: 20 additions & 7 deletions hosts/altdesk/hardware-configuration.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{ config
, lib
, pkgs
, ...
{
config,
lib,
pkgs,
...
}:
{
boot = {
Expand All @@ -22,7 +23,13 @@
'';

initrd = {
availableKernelModules = [ "ahci" "nvme" "usbhid" "usb_storage" "xhci_pci" ];
availableKernelModules = [
"ahci"
"nvme"
"usbhid"
"usb_storage"
"xhci_pci"
];
luks.devices."luks-9ebe5c59-eac5-47eb-b517-c82f2ede2ca3" = {
device = "/dev/disk/by-uuid/9ebe5c59-eac5-47eb-b517-c82f2ede2ca3";
keyFile = "/dev/sda";
Expand All @@ -40,12 +47,18 @@
"/" = {
device = "/dev/disk/by-uuid/4a5edb30-f86b-4ec3-a493-8de48c8ee703";
fsType = "btrfs";
options = [ "subvol=root" "discard=async" ];
options = [
"subvol=root"
"discard=async"
];
};
"/home" = {
device = "/dev/disk/by-uuid/4a5edb30-f86b-4ec3-a493-8de48c8ee703";
fsType = "btrfs";
options = [ "subvol=home" "discard=async" ];
options = [
"subvol=home"
"discard=async"
];
};
};

Expand Down
6 changes: 2 additions & 4 deletions hosts/altdesk/networking.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
{ config
, pkgs
, ...
}: {
{ config, pkgs, ... }:
{
networking.hostName = "altdesk";
}
12 changes: 7 additions & 5 deletions hosts/bifrost/default.nix
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
{ lib
, pkgs
, config
, ...
}: {
{
lib,
pkgs,
config,
...
}:
{
imports = [
./openssh.nix
./secrets.nix
Expand Down
1 change: 0 additions & 1 deletion hosts/bifrost/disk-config.nix
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,3 @@ in
};
};
}

19 changes: 13 additions & 6 deletions hosts/bifrost/hardware-configuration.nix
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
{ config
, lib
, pkgs
, modulesPath
, ...
{
config,
lib,
pkgs,
modulesPath,
...
}:
{
imports = [
Expand All @@ -20,7 +21,13 @@
};

initrd = {
availableKernelModules = [ "ahci" "nvme" "usbhid" "usb_storage" "xhci_pci" ];
availableKernelModules = [
"ahci"
"nvme"
"usbhid"
"usb_storage"
"xhci_pci"
];
};
};
}
12 changes: 7 additions & 5 deletions hosts/bifrost/networking.nix
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
{ lib
, pkgs
, config
, ...
}: {
{
lib,
pkgs,
config,
...
}:
{
networking = {
hostName = "bifrost";
firewall = {
Expand Down
13 changes: 7 additions & 6 deletions hosts/bifrost/openssh.nix
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
{ lib
, pkgs
, config
, ...
}: {
{
lib,
pkgs,
config,
...
}:
{
services = {
openssh = {
enable = true;
Expand All @@ -12,4 +14,3 @@
};
};
}

6 changes: 2 additions & 4 deletions hosts/bifrost/secrets.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
{ config
, pkgs
, ...
}: {
{ config, pkgs, ... }:
{
sops = {
defaultSopsFile = ./secrets.yaml;
secrets = {
Expand Down
Loading

0 comments on commit 4099f53

Please sign in to comment.