refactor: drop disko, simplify inputs, centralize fuse/rclone, bump state versions
- Remove disko everywhere: - Delete hosts/Nixbook/disko.nix and hosts/Nixtest/disko.nix - Drop disko input, modules, and disko-install app - Update README to remove disko mention - Simplify flake inputs: - Use nixpkgs = nixos-unstable only - Home Manager -> master (follows nixpkgs) - Remove nixpkgs-unstable and vscode-extensions - Pass allowUnfree via specialArgs - Centralize storage tools: - Add fuse3 and rclone to hosts/common/default.nix - Remove hosts/common/rclone.nix and screen.nix - Add user thiago to "fuse" group - Drop per-host rclone packages - NVIDIA module: - Use pkgs.linuxPackages.nvidiaPackages.latest (no unstable import) - Keep nvidiaSettings=true, open=false - Remove sunshine service block - Hosts: - Nixstation: remove Hyprland block, zramSwap 30% -> 25% - Clean hardware-configuration args - Versions: - system.stateVersion: 24.05 -> 25.11 (Nixstation) - home.stateVersion: 24.05 -> 25.11 - README: adjust Nixbook and common modules descriptions
This commit is contained in:
parent
60eef49dc2
commit
b41147d8e1
14 changed files with 22 additions and 216 deletions
|
|
@ -6,10 +6,10 @@ The setup is split into host-specific configurations, common reusable modules, a
|
||||||
## Structure
|
## Structure
|
||||||
- **flake.nix** — entry point, defines inputs (nixpkgs, home-manager, nixvim, etc.) and system/home outputs.
|
- **flake.nix** — entry point, defines inputs (nixpkgs, home-manager, nixvim, etc.) and system/home outputs.
|
||||||
- **hosts/** — machine-specific system configurations.
|
- **hosts/** — machine-specific system configurations.
|
||||||
- `Nixbook/` — laptop setup (Apple hardware, Hyprland, disk layout via disko).
|
- `Nixbook/` — laptop setup (Apple hardware, Hyprland)
|
||||||
- `Nixstation/` — desktop workstation (NVIDIA, virtualization, btrfs scrub, firewall).
|
- `Nixstation/` — desktop workstation (NVIDIA, virtualization, btrfs scrub, firewall).
|
||||||
- `Nixtest/` — minimal VM environment for testing with QEMU.
|
- `Nixtest/` — minimal VM environment for testing with QEMU.
|
||||||
- `common/` — shared modules (users, keyboard, network, gpus, rclone, etc.).
|
- `common/` — shared modules (users, keyboard, network, gpus, etc.).
|
||||||
- **home-manager/** — user environment configurations.
|
- **home-manager/** — user environment configurations.
|
||||||
- `home.nix` — main Home Manager entry for user packages and programs.
|
- `home.nix` — main Home Manager entry for user packages and programs.
|
||||||
- `vim.nix`, `zsh.nix`, `gnome.nix`, `hyprland/` — modular desktop and tool configurations.
|
- `vim.nix`, `zsh.nix`, `gnome.nix`, `hyprland/` — modular desktop and tool configurations.
|
||||||
|
|
|
||||||
33
flake.nix
33
flake.nix
|
|
@ -2,57 +2,43 @@
|
||||||
description = "my NixOS Config";
|
description = "my NixOS Config";
|
||||||
|
|
||||||
inputs = {
|
inputs = {
|
||||||
disko.url = "github:nix-community/disko";
|
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
||||||
disko.inputs.nixpkgs.follows = "nixpkgs";
|
|
||||||
nixpkgs.url = "github:nixos/nixpkgs/nixos-25.05";
|
|
||||||
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable";
|
|
||||||
|
|
||||||
home-manager = {
|
home-manager = {
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
url = "github:nix-community/home-manager/release-25.05";
|
url = "github:nix-community/home-manager/master";
|
||||||
};
|
};
|
||||||
nixvim = {
|
nixvim = {
|
||||||
url = "github:nix-community/nixvim";
|
url = "github:nix-community/nixvim";
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
};
|
};
|
||||||
|
|
||||||
vscode-extensions = {
|
|
||||||
url = "github:nix-community/nix-vscode-extensions";
|
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
|
||||||
};
|
|
||||||
|
|
||||||
flake-utils.follows = "vscode-extensions/flake-utils";
|
|
||||||
flake-utils.inputs.nixpkgs.follows = "nixpkgs";
|
flake-utils.inputs.nixpkgs.follows = "nixpkgs";
|
||||||
vs-extensions-pkgs.follows = "vscode-extensions/nixpkgs";
|
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs =
|
outputs =
|
||||||
{ self
|
{ self
|
||||||
, nixpkgs
|
, nixpkgs
|
||||||
, home-manager
|
, home-manager
|
||||||
, nixpkgs-unstable
|
|
||||||
, ...
|
, ...
|
||||||
}@inputs:
|
}@inputs:
|
||||||
let
|
let
|
||||||
inherit (self) outputs;
|
inherit (self) outputs;
|
||||||
system = "x86_64-linux";
|
|
||||||
unstable = import nixpkgs-unstable { inherit system; config.allowUnfree = true; };
|
|
||||||
pkgs = import nixpkgs { inherit system; config.allowUnfree = true; };
|
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
nixosConfigurations = {
|
nixosConfigurations = {
|
||||||
Nixbook = nixpkgs.lib.nixosSystem {
|
Nixbook = nixpkgs.lib.nixosSystem {
|
||||||
specialArgs = {
|
specialArgs = {
|
||||||
inherit inputs outputs;
|
inherit inputs outputs;
|
||||||
|
allowUnfree = true;
|
||||||
};
|
};
|
||||||
modules = [
|
modules = [
|
||||||
./hosts/Nixbook
|
./hosts/Nixbook
|
||||||
./hosts/Nixbook/disko.nix
|
|
||||||
inputs.disko.nixosModules.disko
|
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
Nixstation = nixpkgs.lib.nixosSystem {
|
Nixstation = nixpkgs.lib.nixosSystem {
|
||||||
specialArgs = { inherit inputs outputs unstable; };
|
specialArgs = {
|
||||||
|
inherit inputs outputs;
|
||||||
|
allowUnfree = true;};
|
||||||
modules = [
|
modules = [
|
||||||
./hosts/Nixstation
|
./hosts/Nixstation
|
||||||
];
|
];
|
||||||
|
|
@ -83,12 +69,5 @@
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
apps.x86_64-linux.disko-install = {
|
|
||||||
type = "app";
|
|
||||||
program = "${inputs.disko.packages.x86_64-linux.disko}/bin/disko-install";
|
|
||||||
};
|
|
||||||
|
|
||||||
devShells.x86_64-linux = { };
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -49,7 +49,6 @@
|
||||||
obsidian
|
obsidian
|
||||||
python3
|
python3
|
||||||
python3Packages.pip
|
python3Packages.pip
|
||||||
rclone
|
|
||||||
ripgrep
|
ripgrep
|
||||||
shfmt
|
shfmt
|
||||||
statix
|
statix
|
||||||
|
|
@ -151,5 +150,5 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
systemd.user.startServices = "sd-switch";
|
systemd.user.startServices = "sd-switch";
|
||||||
home.stateVersion = "24.05";
|
home.stateVersion = "25.11";
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -48,7 +48,6 @@
|
||||||
neovim
|
neovim
|
||||||
nil
|
nil
|
||||||
nixpkgs-fmt
|
nixpkgs-fmt
|
||||||
rclone
|
|
||||||
wget
|
wget
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,68 +0,0 @@
|
||||||
{ config, lib, ... }:
|
|
||||||
|
|
||||||
{
|
|
||||||
disko.devices = {
|
|
||||||
disk.main = {
|
|
||||||
type = "disk";
|
|
||||||
device = "/dev/nvme0n1";
|
|
||||||
content = {
|
|
||||||
type = "gpt";
|
|
||||||
partitions = {
|
|
||||||
esp = {
|
|
||||||
size = "512M";
|
|
||||||
start = "1M";
|
|
||||||
type = "EF00";
|
|
||||||
label = "EFI";
|
|
||||||
content = {
|
|
||||||
type = "filesystem";
|
|
||||||
format = "vfat";
|
|
||||||
mountpoint = "/boot";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
swap = {
|
|
||||||
size = "16G";
|
|
||||||
type = "8200";
|
|
||||||
label = "Swap";
|
|
||||||
content = {
|
|
||||||
type = "swap";
|
|
||||||
randomEncryption = false;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
root = {
|
|
||||||
type = "8300";
|
|
||||||
label = "NixOS";
|
|
||||||
size = "870G";
|
|
||||||
content = {
|
|
||||||
type = "btrfs";
|
|
||||||
mountpoint = "/";
|
|
||||||
subvolumes = {
|
|
||||||
"@root" = {
|
|
||||||
mountpoint = "/";
|
|
||||||
};
|
|
||||||
"@nix" = {
|
|
||||||
mountpoint = "/nix";
|
|
||||||
};
|
|
||||||
"@home" = {
|
|
||||||
mountpoint = "/home";
|
|
||||||
};
|
|
||||||
"@log" = {
|
|
||||||
mountpoint = "/var/log";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
extraArgs = [
|
|
||||||
"-L"
|
|
||||||
"nixos-root"
|
|
||||||
];
|
|
||||||
mountOptions = [
|
|
||||||
"compress=zstd"
|
|
||||||
"noatime"
|
|
||||||
];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
@ -1,8 +1,6 @@
|
||||||
{ config
|
{ config
|
||||||
, lib
|
, lib
|
||||||
, pkgs
|
|
||||||
, modulesPath
|
, modulesPath
|
||||||
, inputs
|
|
||||||
, ...
|
, ...
|
||||||
}:
|
}:
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -8,8 +8,6 @@
|
||||||
../common/keychron.nix
|
../common/keychron.nix
|
||||||
../common/network.nix
|
../common/network.nix
|
||||||
../common/nvidia/default.nix
|
../common/nvidia/default.nix
|
||||||
../common/rclone.nix
|
|
||||||
../common/screen.nix
|
|
||||||
./hardware-configuration.nix
|
./hardware-configuration.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
@ -111,11 +109,6 @@
|
||||||
|
|
||||||
# };
|
# };
|
||||||
dconf.enable = true;
|
dconf.enable = true;
|
||||||
hyprland = {
|
|
||||||
enable = false;
|
|
||||||
withUWSM = true;
|
|
||||||
xwayland.enable = true;
|
|
||||||
};
|
|
||||||
virt-manager.enable = true;
|
virt-manager.enable = true;
|
||||||
};
|
};
|
||||||
security.pam.services.gdm.enableGnomeKeyring = true;
|
security.pam.services.gdm.enableGnomeKeyring = true;
|
||||||
|
|
@ -150,8 +143,6 @@
|
||||||
|
|
||||||
flatpak.enable = true;
|
flatpak.enable = true;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
pipewire = {
|
pipewire = {
|
||||||
enable = true;
|
enable = true;
|
||||||
alsa.enable = true;
|
alsa.enable = true;
|
||||||
|
|
@ -159,6 +150,7 @@
|
||||||
pulse.enable = true;
|
pulse.enable = true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
systemd = {
|
systemd = {
|
||||||
services."getty@tty1".enable = false;
|
services."getty@tty1".enable = false;
|
||||||
services."autovt@tty1".enable = false;
|
services."autovt@tty1".enable = false;
|
||||||
|
|
@ -184,7 +176,7 @@
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
system.stateVersion = "24.05"; # keep it!
|
system.stateVersion = "25.11"; # keep it!
|
||||||
time.timeZone = "America/Sao_Paulo";
|
time.timeZone = "America/Sao_Paulo";
|
||||||
virtualisation = {
|
virtualisation = {
|
||||||
vmware.host.enable = false;
|
vmware.host.enable = false;
|
||||||
|
|
@ -199,7 +191,7 @@
|
||||||
|
|
||||||
zramSwap = {
|
zramSwap = {
|
||||||
enable = true;
|
enable = true;
|
||||||
memoryPercent = 30;
|
memoryPercent = 25;
|
||||||
algorithm = "zstd";
|
algorithm = "zstd";
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,6 @@
|
||||||
{ pkgs, ... }:
|
{ pkgs, ... }:
|
||||||
{
|
{
|
||||||
|
|
||||||
imports = [
|
|
||||||
./disko.nix
|
|
||||||
];
|
|
||||||
|
|
||||||
networking.hostName = "Nixtest";
|
networking.hostName = "Nixtest";
|
||||||
services = {
|
services = {
|
||||||
xserver.enable = true;
|
xserver.enable = true;
|
||||||
|
|
|
||||||
|
|
@ -1,58 +0,0 @@
|
||||||
{ config, lib, ... }:
|
|
||||||
|
|
||||||
{
|
|
||||||
disko.devices = {
|
|
||||||
disk.main = {
|
|
||||||
type = "disk";
|
|
||||||
device = "/dev/nvme0n1";
|
|
||||||
content = {
|
|
||||||
type = "gpt";
|
|
||||||
partitions = {
|
|
||||||
esp = {
|
|
||||||
size = "128M";
|
|
||||||
start = "1M";
|
|
||||||
type = "EF00";
|
|
||||||
label = "EFI";
|
|
||||||
content = {
|
|
||||||
type = "filesystem";
|
|
||||||
format = "vfat";
|
|
||||||
mountpoint = "/boot";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
root = {
|
|
||||||
type = "8300";
|
|
||||||
label = "NixOS";
|
|
||||||
size = "32G";
|
|
||||||
content = {
|
|
||||||
type = "btrfs";
|
|
||||||
mountpoint = "/";
|
|
||||||
subvolumes = {
|
|
||||||
"@root" = {
|
|
||||||
mountpoint = "/";
|
|
||||||
};
|
|
||||||
"@nix" = {
|
|
||||||
mountpoint = "/nix";
|
|
||||||
};
|
|
||||||
"@home" = {
|
|
||||||
mountpoint = "/home";
|
|
||||||
};
|
|
||||||
"@log" = {
|
|
||||||
mountpoint = "/var/log";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
extraArgs = [
|
|
||||||
"-L"
|
|
||||||
"nixos-root"
|
|
||||||
];
|
|
||||||
mountOptions = [
|
|
||||||
"compress=zstd"
|
|
||||||
"noatime"
|
|
||||||
];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
@ -19,6 +19,7 @@
|
||||||
systemPackages = with pkgs; [
|
systemPackages = with pkgs; [
|
||||||
exfat
|
exfat
|
||||||
file
|
file
|
||||||
|
fuse3
|
||||||
gcsfuse
|
gcsfuse
|
||||||
git
|
git
|
||||||
gnupg
|
gnupg
|
||||||
|
|
@ -29,6 +30,7 @@
|
||||||
pcsc-safenet
|
pcsc-safenet
|
||||||
pcsctools
|
pcsctools
|
||||||
pkcs11helper
|
pkcs11helper
|
||||||
|
rclone
|
||||||
sops
|
sops
|
||||||
wget
|
wget
|
||||||
zsa-udev-rules
|
zsa-udev-rules
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,4 @@
|
||||||
{ config
|
{ pkgs
|
||||||
, pkgs
|
|
||||||
, unstable
|
|
||||||
, ...
|
, ...
|
||||||
}:
|
}:
|
||||||
{
|
{
|
||||||
|
|
@ -19,39 +17,27 @@
|
||||||
};
|
};
|
||||||
nvidia = {
|
nvidia = {
|
||||||
modesetting.enable = true;
|
modesetting.enable = true;
|
||||||
|
nvidiaSettings = true;
|
||||||
|
open = false; # keep it like that for now, unstable!!
|
||||||
|
package = pkgs.linuxPackages.nvidiaPackages.latest;
|
||||||
powerManagement.enable = false;
|
powerManagement.enable = false;
|
||||||
powerManagement.finegrained = false;
|
powerManagement.finegrained = false;
|
||||||
open = false; # keep it like that for now, unstable!!
|
|
||||||
nvidiaSettings = true;
|
|
||||||
package = unstable.linuxPackages.nvidiaPackages.latest;
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
services = {
|
services = {
|
||||||
sunshine = {
|
|
||||||
enable = false;
|
|
||||||
# autoStart = true;
|
|
||||||
# openFirewall = true;
|
|
||||||
package = pkgs.sunshine.overrideAttrs (old: {
|
|
||||||
cmakeFlags = (old.cmakeFlags or [ ]) ++ [
|
|
||||||
"-DSUNSHINE_ENABLE_CUDA=OFF"
|
|
||||||
"-DCUDA_FAIL_ON_MISSING=OFF"
|
|
||||||
];
|
|
||||||
});
|
|
||||||
};
|
|
||||||
xserver = {
|
xserver = {
|
||||||
videoDrivers = [ "nvidia" ];
|
videoDrivers = [ "nvidia" ];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
nixpkgs.config.cudaSupport = true;
|
nixpkgs.config.cudaSupport = true;
|
||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = with pkgs; [
|
||||||
mesa
|
cudaPackages.cuda_nvcc
|
||||||
|
cudaPackages.cudatoolkit
|
||||||
glxinfo
|
glxinfo
|
||||||
libepoxy
|
libepoxy
|
||||||
libglvnd
|
libglvnd
|
||||||
|
mesa
|
||||||
nvidia-container-toolkit
|
nvidia-container-toolkit
|
||||||
cudaPackages.cudatoolkit
|
|
||||||
cudaPackages.cuda_nvcc
|
|
||||||
];
|
];
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,12 +0,0 @@
|
||||||
{ pkgs, ... }:
|
|
||||||
|
|
||||||
{
|
|
||||||
environment.systemPackages = with pkgs; [
|
|
||||||
rclone
|
|
||||||
fuse3 # Required for mounting
|
|
||||||
];
|
|
||||||
|
|
||||||
users.users.thiago = {
|
|
||||||
extraGroups = [ "fuse" ];
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
@ -1,8 +0,0 @@
|
||||||
{ pkgs, ... }:
|
|
||||||
{
|
|
||||||
hardware.i2c.enable = true;
|
|
||||||
environment.systemPackages = with pkgs; [
|
|
||||||
ddcutil
|
|
||||||
ddcui
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
@ -9,6 +9,7 @@ in
|
||||||
initialPassword = "changeme";
|
initialPassword = "changeme";
|
||||||
extraGroups =
|
extraGroups =
|
||||||
[
|
[
|
||||||
|
"fuse"
|
||||||
"networkmanager"
|
"networkmanager"
|
||||||
"wheel"
|
"wheel"
|
||||||
"scard"
|
"scard"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue