Skip to content

Commit

Permalink
reformatting of all nix files to standard (not rfc)
Browse files Browse the repository at this point in the history
  • Loading branch information
Flameopathic committed Jul 30, 2024
1 parent 3d9aadf commit 0c55e79
Show file tree
Hide file tree
Showing 43 changed files with 555 additions and 521 deletions.
252 changes: 130 additions & 122 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,152 +9,160 @@
url = "github:Flameopathic/home-manager/release-24.05"; # TODO: change back once vesktop module is merged
inputs.nixpkgs.follows = "nixpkgs"; # ensures nixpkgs version is consistent between home manager and system
};
nix-darwin = { # declarative macOS with nix
nix-darwin = {
# declarative macOS with nix
url = "github:LnL7/nix-darwin";
inputs.nixpkgs.follows = "nixpkgs";
};
lanzaboote = { # secure boot
lanzaboote = {
# secure boot
url = "github:nix-community/lanzaboote/v0.3.0";
inputs.nixpkgs.follows = "nixpkgs";
};
firefox-addons = {
url = "gitlab:rycee/nur-expressions?dir=pkgs/firefox-addons";
inputs.nixpkgs.follows = "nixpkgs";
};
disko = { # declarative disks
disko = {
# declarative disks
url = "github:nix-community/disko";
inputs.nixpkgs.follows = "nixpkgs";
};
vscode-server = { # makes remote servers work
vscode-server = {
# makes remote servers work
url = "github:nix-community/nixos-vscode-server";
inputs.nixpkgs.follows = "nixpkgs";
};
nix-colors.url = "github:Misterio77/nix-colors";
};

outputs = { ... }@inputs: with inputs; {
nixosConfigurations = let
mkHost = host: { modules ? [], home-modules ? [], system ? "x86_64-linux", specialArgs ? { inherit inputs; }, ... }: nixpkgs.lib.nixosSystem {
system = system;
modules = modules ++ [
({ ... }: {
networking.hostName = host;
})
./mod
home-manager.nixosModules.home-manager
{
home-manager = {
useGlobalPkgs = true;
useUserPackages = false;
extraSpecialArgs = { inherit inputs; };
users.flame = {
imports = home-modules ++ [
./mod-hm
] ++ nixpkgs.lib.optional (builtins.pathExists ./host/${host}/home.nix) ./host/${host}/home.nix;
nixosConfigurations =
let
mkHost = host: { modules ? [ ], home-modules ? [ ], system ? "x86_64-linux", specialArgs ? { inherit inputs; }, ... }: nixpkgs.lib.nixosSystem {
system = system;
modules = modules ++ [
({ ... }: {
networking.hostName = host;
})
./mod
home-manager.nixosModules.home-manager
{
home-manager = {
useGlobalPkgs = true;
useUserPackages = false;
extraSpecialArgs = { inherit inputs; };
users.flame = {
imports = home-modules ++ [
./mod-hm
] ++ nixpkgs.lib.optional (builtins.pathExists ./host/${host}/home.nix) ./host/${host}/home.nix;
};
};
};
}
] ++ nixpkgs.lib.optional (builtins.pathExists ./host/${host}/hardware-configuration.nix) ./host/${host}/hardware-configuration.nix
++ nixpkgs.lib.optional (builtins.pathExists ./host/${host}/configuration.nix) ./host/${host}/configuration.nix;
specialArgs = specialArgs;
};
}
] ++ nixpkgs.lib.optional (builtins.pathExists ./host/${host}/hardware-configuration.nix) ./host/${host}/hardware-configuration.nix
++ nixpkgs.lib.optional (builtins.pathExists ./host/${host}/configuration.nix) ./host/${host}/configuration.nix;
specialArgs = specialArgs;
};

in builtins.mapAttrs mkHost {
# make configuration name same as host name to make rebuild command work automagically
# system default is "x86_64-linux"
# modules default to ./mod and ./host/${host}/configuration.nix
# specialArgs defaults to inheriting inputs alone
fnix2 = {
modules = [
./mod/sd-boot.nix
./mod/ui.nix
./mod/hyprland.nix
./mod/nvidia.nix
./mod/remote-builder.nix
./mod/ssh-server.nix
./mod/syncthing.nix
];
home-modules = [
{
flame.hyprland.monitor = [ "Unknown-1, disabled" "DP-1, highres, 0x0, auto" "HDMI-A-1, highres, 3200x1440, 1" ];
}
./mod-hm/ui-apps.nix
];
};
surfnix = {
modules = [
./mod/sd-boot.nix
./mod/ui.nix
./mod/hyprland.nix
./mod/surface.nix
./mod/syncthing.nix
];
home-modules = [
{
flame.hyprland.monitor = [ "eDP-1, preferred, 1920x0, auto" "DP-1, preferred, 0x0, 1" ];
}
./mod-hm/ui-apps.nix
];
};
servnix = {
system = "aarch64-linux";
modules = [
./mod/rpi-boot.nix
./mod/ssh-server.nix
./mod/syncthing.nix
{
flame.syncthing.server = true;
}
];
};
shaktop = {
modules = [
./mod/sd-boot.nix
./mod/mc-server.nix
./mod/laptop-server.nix
./mod/ssh-server.nix
./mod/unturned.nix
{
flame.ssh-server.openFirewall = true;
}
];
in
builtins.mapAttrs mkHost {
# make configuration name same as host name to make rebuild command work automagically
# system default is "x86_64-linux"
# modules default to ./mod and ./host/${host}/configuration.nix
# specialArgs defaults to inheriting inputs alone
fnix2 = {
modules = [
./mod/sd-boot.nix
./mod/ui.nix
./mod/hyprland.nix
./mod/nvidia.nix
./mod/remote-builder.nix
./mod/ssh-server.nix
./mod/syncthing.nix
];
home-modules = [
{
flame.hyprland.monitor = [ "Unknown-1, disabled" "DP-1, highres, 0x0, auto" "HDMI-A-1, highres, 3200x1440, 1" ];
}
./mod-hm/ui-apps.nix
];
};
surfnix = {
modules = [
./mod/sd-boot.nix
./mod/ui.nix
./mod/hyprland.nix
./mod/surface.nix
./mod/syncthing.nix
];
home-modules = [
{
flame.hyprland.monitor = [ "eDP-1, preferred, 1920x0, auto" "DP-1, preferred, 0x0, 1" ];
}
./mod-hm/ui-apps.nix
];
};
servnix = {
system = "aarch64-linux";
modules = [
./mod/rpi-boot.nix
./mod/ssh-server.nix
./mod/syncthing.nix
{
flame.syncthing.server = true;
}
];
};
shaktop = {
modules = [
./mod/sd-boot.nix
./mod/mc-server.nix
./mod/laptop-server.nix
./mod/ssh-server.nix
./mod/unturned.nix
{
flame.ssh-server.openFirewall = true;
}
];
};
acervnix = {
modules = [
disko.nixosModules.disko
./host/acervnix/disk-config.nix
./mod/sd-boot.nix
./mod/ssh-server.nix
./mod/laptop-server.nix
];
};
};
acervnix = {
modules = [
disko.nixosModules.disko
./host/acervnix/disk-config.nix
./mod/sd-boot.nix
./mod/ssh-server.nix
./mod/laptop-server.nix
];
};
};
darwinConfigurations = let
mkDarwin = host: { modules ? [], home-modules ? [], system ? "x86_64-darwin", specialArgs ? { inherit inputs; }, ... }: nix-darwin.lib.darwinSystem {
modules = modules ++ [
({ ... }: {
networking.hostName = host;
nixpkgs.hostPlatform = system;
})
./host/${host}/configuration.nix
home-manager.nixosModules.home-manager
{
home-manager = {
useGlobalPkgs = true;
useUserPackages = true;
extraSpecialArgs = { inherit inputs; };
users.flame = {
imports = home-modules ++ [
./mod-hm
];
darwinConfigurations =
let
mkDarwin = host: { modules ? [ ], home-modules ? [ ], system ? "x86_64-darwin", specialArgs ? { inherit inputs; }, ... }: nix-darwin.lib.darwinSystem {
modules = modules ++ [
({ ... }: {
networking.hostName = host;
nixpkgs.hostPlatform = system;
})
./host/${host}/configuration.nix
home-manager.nixosModules.home-manager
{
home-manager = {
useGlobalPkgs = true;
useUserPackages = true;
extraSpecialArgs = { inherit inputs; };
users.flame = {
imports = home-modules ++ [
./mod-hm
];
};
};
};
}
];
specialArgs = specialArgs;
}
];
specialArgs = specialArgs;
};
in
builtins.mapAttrs mkDarwin {
bear = { };
};
in builtins.mapAttrs mkDarwin {
bear = {};
};
};
}
2 changes: 1 addition & 1 deletion host/acervnix/configuration.nix
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{ ... }: {
system.stateVersion = "24.11";
}
}
2 changes: 1 addition & 1 deletion host/acervnix/disk-config.nix
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,4 @@
};
};
};
}
}
6 changes: 3 additions & 3 deletions host/acervnix/hardware-configuration.nix
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{ lib, config, ... }: {
boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "sd_mod" "sr_mod" "rtsx_usb_sdmmc" ];
boot.initrd.kernelModules = [];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm_intel" ];
boot.extraModulePackages = [];
boot.extraModulePackages = [ ];

networking.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}
}
2 changes: 1 addition & 1 deletion host/acervnix/home.nix
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
home.stateVersion = "24.05"; # home manager can be updated without changing this - read documentation
}
}
2 changes: 1 addition & 1 deletion host/fnix2/configuration.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

environment.systemPackages = with pkgs; [
solaar
(pkgs.callPackage ../../pkgs/wl-clicker {})
(pkgs.callPackage ../../pkgs/wl-clicker { })
];

system.stateVersion = "23.11"; # shouldn't be changed
Expand Down
12 changes: 7 additions & 5 deletions host/fnix2/hardware-configuration.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@

{
imports =
[ (modulesPath + "/installer/scan/not-detected.nix")
[
(modulesPath + "/installer/scan/not-detected.nix")
];

boot.initrd.availableKernelModules = [ "vmd" "xhci_pci" "ahci" "nvme" "usbhid" "uas" "sd_mod" ];
Expand All @@ -14,18 +15,19 @@
boot.extraModulePackages = [ ];

fileSystems."/" =
{ device = "/dev/disk/by-label/nixos";
{
device = "/dev/disk/by-label/nixos";
fsType = "ext4";
};

fileSystems."/boot" =
{ device = "/dev/disk/by-label/boot";
{
device = "/dev/disk/by-label/boot";
fsType = "vfat";
};

swapDevices =
[ { device = "/dev/disk/by-label/swap"; }
];
[{ device = "/dev/disk/by-label/swap"; }];

# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
# (the default) this is the recommended approach. When using systemd-networkd it's
Expand Down
2 changes: 1 addition & 1 deletion host/fnix2/home.nix
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
home.stateVersion = "23.11"; # home manager can be updated without changing this - read documentation
}
}
2 changes: 1 addition & 1 deletion host/servnix/configuration.nix
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{ ... }: {
system.stateVersion = "23.11"; # read docs before changing
system.stateVersion = "23.11"; # read docs before changing
}
9 changes: 6 additions & 3 deletions host/servnix/hardware-configuration.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@

{
imports =
[ (modulesPath + "/installer/scan/not-detected.nix")
[
(modulesPath + "/installer/scan/not-detected.nix")
];

boot.initrd.availableKernelModules = [ "xhci_pci" "usb_storage" ];
Expand All @@ -14,12 +15,14 @@
boot.extraModulePackages = [ ];

fileSystems."/" =
{ device = "/dev/disk/by-uuid/44444444-4444-4444-8888-888888888888";
{
device = "/dev/disk/by-uuid/44444444-4444-4444-8888-888888888888";
fsType = "ext4";
};

fileSystems."/home/flame" =
{ device = "/dev/md0";
{
device = "/dev/md0";
fsType = "ext4";
};

Expand Down
Loading

0 comments on commit 0c55e79

Please sign in to comment.