From 73c352c8723268d335962e7f66c5fffc22e09286 Mon Sep 17 00:00:00 2001
From: Thiago Sposito
Date: Sat, 30 Aug 2025 23:19:46 -0300
Subject: [PATCH] feat: nixbook on gnome wayland
---
.build.yml | 12 +-
flake.lock | 6 +-
home-manager/home.nix | 1 +
hosts/Nixbook/default.nix | 169 +++++++++++++++++++----
hosts/Nixbook/hardware-configuration.nix | 39 +++++-
hosts/Nixstation/default.nix | 5 +-
hosts/common/default.nix | 10 +-
hosts/common/network.nix | 1 -
my-mailmap | 4 -
9 files changed, 196 insertions(+), 51 deletions(-)
delete mode 100644 my-mailmap
diff --git a/.build.yml b/.build.yml
index 199b0e1..a8b1cd5 100644
--- a/.build.yml
+++ b/.build.yml
@@ -1,15 +1,13 @@
image: nixos/unstable
environment:
NIX_CONFIG: "experimental-features = nix-command flakes"
+ MY_NIX_FLAGS: "--extra-experimental-features command --extra-experimental-features flakes"
sources:
- https://git.sr.ht/~sposito/nix-conf
tasks:
- - build: |
- cd nix-conf
- nix flake check
- check_fmt: |
- cd nix-conf
- nixpkgs-fmt --check .
+ cd ~/nix-conf
+ nix run nixpkgs#nixpgs-fmt ${MY_NIX_FLAGS} -- --check .
- static: |
- cd nix-conf
- nix run nixpkgs#statix check .
+ cd ~/nix-conf
+ nix run nixpkgs#statix ${MY_NIX_FLAGS} -- check .
diff --git a/flake.lock b/flake.lock
index f6d90b8..8613b67 100644
--- a/flake.lock
+++ b/flake.lock
@@ -114,11 +114,11 @@
"systems": "systems_2"
},
"locked": {
- "lastModified": 1756305488,
- "narHash": "sha256-+6cgFdac+DN5PAZg3YtRXAEdk++r6msy7wfFMNMNsEY=",
+ "lastModified": 1756587208,
+ "narHash": "sha256-pATHF/7rZeEYxnkvLZgrLbCjG4xBJDJ4zkjUiu+hhiU=",
"owner": "nix-community",
"repo": "nixvim",
- "rev": "b7e96214e8e7244eceae73c606dcd243f6d180a3",
+ "rev": "8bad4d407dace583ebf6a41d32cab479788898fe",
"type": "github"
},
"original": {
diff --git a/home-manager/home.nix b/home-manager/home.nix
index 9c5f7ee..589af5c 100644
--- a/home-manager/home.nix
+++ b/home-manager/home.nix
@@ -38,6 +38,7 @@
libinput
nerd-fonts.fira-code
nil
+ nixd
nixpkgs-fmt
nixfmt-rfc-style
nordic
diff --git a/hosts/Nixbook/default.nix b/hosts/Nixbook/default.nix
index 6dcff84..e2e08b3 100644
--- a/hosts/Nixbook/default.nix
+++ b/hosts/Nixbook/default.nix
@@ -3,41 +3,17 @@
imports = [
../common/default.nix
+ ../common/network.nix
./apple.nix
./hardware-configuration.nix
];
-
- networking.hostName = "Nixbook";
-
- programs.hyprland.enable = true;
- programs.hyprland.withUWSM = true;
-
- environment.sessionVariables = {
- NIXOS_OZONE_WL = "1";
- };
-
- services = {
- xserver.enable = true;
-
- displayManager.sddm = {
- enable = true;
- wayland.enable = true;
- };
-
- libinput = {
- enable = true;
- touchpad.clickMethod = "clickfinger";
- };
-
- openssh = {
- enable = true;
- settings = {
- PermitRootLogin = "yes";
- PasswordAuthentication = false;
- };
- };
+ boot = {
+ loader.systemd-boot.enable = true;
+ loader.efi.canTouchEfiVariables = true;
+ kernelPackages = pkgs.linuxPackages_latest;
};
+ environment.sessionVariables = { NIXOS_OZONE_WL = "1"; };
environment.systemPackages = with pkgs; [
exfat
gcsfuse
@@ -51,5 +27,138 @@
wget
];
+ networking.hostName = "Nixbook";
+ programs.hyprland.enable = false;
+ programs.hyprland.withUWSM = false;
+
+ hardware = {
+ sane.enable = true;
+ graphics.enable = true;
+ };
+
+ i18n.defaultLocale = "en_US.UTF-8";
+ i18n.extraLocaleSettings = {
+ LC_ADDRESS = "pt_BR.UTF-8";
+ LC_IDENTIFICATION = "pt_BR.UTF-8";
+ LC_MEASUREMENT = "pt_BR.UTF-8";
+ LC_MONETARY = "pt_BR.UTF-8";
+ LC_NAME = "pt_BR.UTF-8";
+ LC_NUMERIC = "pt_BR.UTF-8";
+ LC_PAPER = "pt_BR.UTF-8";
+ LC_TELEPHONE = "pt_BR.UTF-8";
+ LC_TIME = "pt_BR.UTF-8";
+ };
+
+ nix = {
+ settings = {
+ auto-optimise-store = true;
+ };
+ };
+
+ programs = {
+ dconf.enable = true;
+ virt-manager.enable = true;
+ };
+
+ security = {
+ pam.services.gdm.enableGnomeKeyring = true;
+ polkit.enable = true;
+ polkit.extraConfig = ''
+ polkit.addRule(function(action, subject) {
+ if (action.id == "org.bluez.GattProfile1.Release") {
+ return polkit.Result.YES;
+ }
+ });
+ '';
+ rtkit.enable = true;
+ };
+ services = {
+ xserver = {
+ enable = true;
+ xkb = {
+ layout = "us";
+ variant = "alt-intl";
+ };
+ };
+
+ desktopManager.gnome.enable = true;
+
+ displayManager = {
+ gdm.enable = true;
+ gdm.wayland = true;
+ defaultSession = "gnome";
+ };
+
+ udev.packages = [ pkgs.libwacom ];
+
+ avahi = {
+ enable = true;
+ nssmdns4 = true;
+ openFirewall = true;
+ extraConfig = ''
+ [server]
+ allow-interfaces=wlp7s0
+ '';
+ };
+
+ earlyoom = {
+ enable = true;
+ freeMemThreshold = 5;
+ freeSwapThreshold = 10;
+ };
+
+ flatpak.enable = true;
+
+ libinput = {
+ enable = true;
+ touchpad.clickMethod = "clickfinger";
+ };
+
+ openssh = {
+ enable = true;
+ settings = {
+ PermitRootLogin = "yes";
+ PasswordAuthentication = false;
+ };
+ };
+
+ pipewire = {
+ enable = true;
+ alsa.enable = true;
+ alsa.support32Bit = true;
+ pulse.enable = true;
+ };
+ };
+
+ systemd = {
+ services."getty@tty1".enable = false;
+ services."autovt@tty1".enable = false;
+ };
+
+ systemd.timers.btrfs-scrub = {
+ description = "Run Btrfs Scrub Daily";
+ wantedBy = [ "timers.target" ];
+ timerConfig = {
+ OnCalendar = "daily";
+ Persistent = true;
+ };
+ };
+
+ systemd.services = {
+ btrfs-scrub = {
+ description = "Daily Btrfs Scrub";
+ serviceConfig = {
+ Type = "oneshot";
+ Nice = 19;
+ IOSchedulingClass = "idle";
+ ExecStart = "${pkgs.btrfs-progs}/bin/btrfs scrub start -n 2 -B / && ${pkgs.btrfs-progs}/bin/btrfs scrub start -n 2 -B /mnt/hdd0";
+ };
+ };
+ };
+
+
+
+
+
system.stateVersion = "23.11";
}
diff --git a/hosts/Nixbook/hardware-configuration.nix b/hosts/Nixbook/hardware-configuration.nix
index 00082d9..a76fc96 100644
--- a/hosts/Nixbook/hardware-configuration.nix
+++ b/hosts/Nixbook/hardware-configuration.nix
@@ -23,11 +23,44 @@
extraModulePackages = [ ];
};
- fileSystems."/" = {
- device = "/dev/nvme0n1";
- fsType = "btrfs";
+ fileSystems."/" =
+ {
+ device = "/dev/disk/by-uuid/492e3157-429e-4b9b-995f-c341c83b17ab";
+ fsType = "btrfs";
+ options = [ "subvol=@root" ];
+ };
+
+ fileSystems."/nix" =
+ {
+ device = "/dev/disk/by-uuid/492e3157-429e-4b9b-995f-c341c83b17ab";
+ fsType = "btrfs";
+ options = [ "subvol=@nix" ];
+ };
+
+ fileSystems."/var/log" =
+ {
+ device = "/dev/disk/by-uuid/492e3157-429e-4b9b-995f-c341c83b17ab";
+ fsType = "btrfs";
+ options = [ "subvol=@log" ];
+ };
+
+ fileSystems."/home" =
+ {
+ device = "/dev/disk/by-uuid/492e3157-429e-4b9b-995f-c341c83b17ab";
+ fsType = "btrfs";
+ options = [ "subvol=@home" ];
+ };
+
+ fileSystems."/boot" = {
+ device = "/dev/disk/by-uuid/50A0-7758";
+ fsType = "vfat";
+ options = [ "fmask=0022" "dmask=0022" ];
};
+ swapDevices = [
+ { device = "/dev/disk/by-uuid/fab2d71e-86d2-4ba7-841c-13b790357a73"; }
+ ];
+
networking.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
diff --git a/hosts/Nixstation/default.nix b/hosts/Nixstation/default.nix
index b8ba635..1c0ecec 100644
--- a/hosts/Nixstation/default.nix
+++ b/hosts/Nixstation/default.nix
@@ -42,14 +42,15 @@
};
networking.firewall = {
- enable = true;
- allowPing = true;
allowedTCPPorts = [
11434
8888
8000
8080
];
+ allowPing = true;
+ enable = true;
+ hostName = "Nixstation";
};
nix = {
diff --git a/hosts/common/default.nix b/hosts/common/default.nix
index d07253d..bfea323 100644
--- a/hosts/common/default.nix
+++ b/hosts/common/default.nix
@@ -52,7 +52,15 @@
};
nixpkgs.config.allowUnfree = true;
- programs.zsh.enable = true;
+ programs = {
+ zsh.enable = true;
+ gnupg = {
+ agent = {
+ enable = true;
+ pinentryPackage = pkgs.pinentry-tty;
+ };
+ };
+ };
services = {
pcscd.enable = true;
# xserver.displayManager.sessionCommands =
diff --git a/hosts/common/network.nix b/hosts/common/network.nix
index f97adf0..b4f44f1 100644
--- a/hosts/common/network.nix
+++ b/hosts/common/network.nix
@@ -1,7 +1,6 @@
{ pkgs, ... }:
{
networking = {
- hostName = "Nixstation";
networkmanager.enable = true;
firewall = {
diff --git a/my-mailmap b/my-mailmap
deleted file mode 100644
index 2f14013..0000000
--- a/my-mailmap
+++ /dev/null
@@ -1,4 +0,0 @@
-Thiago Sposito Thiago Sposito
-Thiago Alexandria Sposito Thiago Sposito
-Thiago Alexandria Sposito Thiago Sposito
-