Merge pull request 'Chore/nixfiles review fixes' (#14) from chore/nixfiles-review-fixes into main
CI / flake (push) Successful in 2m15s
CI / flake (push) Successful in 2m15s
Reviewed-on: #14
This commit was merged in pull request #14.
This commit is contained in:
@@ -32,9 +32,9 @@ jobs:
|
|||||||
run: nix build --print-build-logs '.#checks.x86_64-linux.formatting'
|
run: nix build --print-build-logs '.#checks.x86_64-linux.formatting'
|
||||||
|
|
||||||
# Evaluate (not build) each host's toplevel so eval errors fail CI cheaply.
|
# Evaluate (not build) each host's toplevel so eval errors fail CI cheaply.
|
||||||
# aarch64 hosts evaluate fine on an x86_64 runner; only building would need
|
# aarch64 / darwin hosts evaluate fine on an x86_64 runner; only building
|
||||||
# emulation, which we deliberately avoid here.
|
# would need emulation, which we deliberately avoid here.
|
||||||
- name: Evaluate host configurations
|
- name: Evaluate NixOS host configurations
|
||||||
run: |
|
run: |
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
for host in lyrathorpe-mbp lyrathorpe-x1c emmathorpe-edaas; do
|
for host in lyrathorpe-mbp lyrathorpe-x1c emmathorpe-edaas; do
|
||||||
@@ -43,3 +43,13 @@ jobs:
|
|||||||
echo
|
echo
|
||||||
echo "::endgroup::"
|
echo "::endgroup::"
|
||||||
done
|
done
|
||||||
|
|
||||||
|
- name: Evaluate Darwin host configurations
|
||||||
|
run: |
|
||||||
|
set -euo pipefail
|
||||||
|
for host in lyrathorpe-mac; do
|
||||||
|
echo "::group::eval $host"
|
||||||
|
nix eval --raw ".#darwinConfigurations.$host.config.system.build.toplevel.drvPath"
|
||||||
|
echo
|
||||||
|
echo "::endgroup::"
|
||||||
|
done
|
||||||
|
|||||||
@@ -0,0 +1,45 @@
|
|||||||
|
# nixfiles
|
||||||
|
|
||||||
|
NixOS / nix-darwin / home-manager configuration for all hosts, built from a
|
||||||
|
single flake.
|
||||||
|
|
||||||
|
## Hosts
|
||||||
|
|
||||||
|
Defined in the host table in [`flake.nix`](./flake.nix):
|
||||||
|
|
||||||
|
| Configuration | System | Machine |
|
||||||
|
| ------------------- | --------------- | ---------------------------------------- |
|
||||||
|
| `lyrathorpe-mbp` | `aarch64-linux` | MacBook Pro (Apple Silicon, Asahi) |
|
||||||
|
| `lyrathorpe-x1c` | `x86_64-linux` | ThinkPad X1 |
|
||||||
|
| `emmathorpe-edaas` | `x86_64-linux` | Work WSL box (NixOS-WSL) |
|
||||||
|
| `lyrathorpe-mac` | `aarch64-darwin`| macOS (nix-darwin) |
|
||||||
|
|
||||||
|
Shared layers: `lyrathorpe/home` (home-manager: shell, git, editor),
|
||||||
|
`system/modules/common-nixos.nix` (all NixOS hosts), and
|
||||||
|
`system/modules/laptop.nix` (the physical laptops).
|
||||||
|
|
||||||
|
## Applying
|
||||||
|
|
||||||
|
```sh
|
||||||
|
# NixOS
|
||||||
|
sudo nixos-rebuild switch --flake .#<configuration>
|
||||||
|
# Darwin
|
||||||
|
darwin-rebuild switch --flake .#lyrathorpe-mac
|
||||||
|
```
|
||||||
|
|
||||||
|
## MacBook (Asahi) firmware
|
||||||
|
|
||||||
|
The MBP host references `system/modules/firmware/` for Apple peripheral
|
||||||
|
firmware (Wi-Fi/Bluetooth). Those blobs are **not** redistributable, so the
|
||||||
|
directory is gitignored and a clean checkout will not build `lyrathorpe-mbp`
|
||||||
|
until it is populated out-of-band.
|
||||||
|
|
||||||
|
Copy the firmware extracted during the Asahi install (from
|
||||||
|
`/etc/nixos/firmware` on the freshly-installed machine, or re-extract per the
|
||||||
|
[Asahi NixOS docs](https://github.com/tpwrules/nixos-apple-silicon)) into
|
||||||
|
`system/modules/firmware/` before rebuilding that host.
|
||||||
|
|
||||||
|
## CI
|
||||||
|
|
||||||
|
[`.gitea/workflows/ci.yaml`](./.gitea/workflows/ci.yaml) gates `nixfmt`
|
||||||
|
formatting and evaluates every NixOS and Darwin host configuration on push/PR.
|
||||||
Generated
+4
-3
@@ -174,15 +174,16 @@
|
|||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1780203844,
|
"lastModified": 1780203844,
|
||||||
"narHash": "sha256-K5sT4jTpGs15ADhviMKNBH38REpPf5Q6mM1+N6cArVE=",
|
"narHash": "sha256-K5sT4jTpGs15ADhviMKNBH38REpPf5Q6mM1+N6cArVE=",
|
||||||
"owner": "NixOS",
|
"owner": "nixos",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "b51242d7d43689db2f3be91bd05d5b24fbb469c4",
|
"rev": "b51242d7d43689db2f3be91bd05d5b24fbb469c4",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"id": "nixpkgs",
|
"owner": "nixos",
|
||||||
"ref": "nixos-26.05",
|
"ref": "nixos-26.05",
|
||||||
"type": "indirect"
|
"repo": "nixpkgs",
|
||||||
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"nixpkgs-unstable": {
|
"nixpkgs-unstable": {
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
inputs = {
|
inputs = {
|
||||||
# Pinned stable channel; the single source of truth for every host.
|
# Pinned stable channel; the single source of truth for every host.
|
||||||
nixpkgs.url = "nixpkgs/nixos-26.05";
|
nixpkgs.url = "github:nixos/nixpkgs/nixos-26.05";
|
||||||
# Bleeding-edge channel, used only to pull individual packages via overlay.
|
# Bleeding-edge channel, used only to pull individual packages via overlay.
|
||||||
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable";
|
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable";
|
||||||
# Home-manager release matched to the stable nixpkgs; `follows` keeps a single nixpkgs eval.
|
# Home-manager release matched to the stable nixpkgs; `follows` keeps a single nixpkgs eval.
|
||||||
@@ -74,6 +74,7 @@
|
|||||||
# Shared scaffolding for every NixOS host: common user, settings, home-manager.
|
# Shared scaffolding for every NixOS host: common user, settings, home-manager.
|
||||||
baseModules = [
|
baseModules = [
|
||||||
./lyrathorpe/user.nix
|
./lyrathorpe/user.nix
|
||||||
|
./system/modules/common-nixos.nix
|
||||||
commonModule
|
commonModule
|
||||||
home-manager.nixosModules.home-manager
|
home-manager.nixosModules.home-manager
|
||||||
{
|
{
|
||||||
@@ -97,16 +98,34 @@
|
|||||||
fullName,
|
fullName,
|
||||||
modules,
|
modules,
|
||||||
homeModules,
|
homeModules,
|
||||||
|
# Host form factor. Laptops inherit the default; a desktop host sets
|
||||||
|
# `portable = false` to drop mobile components (battery block,
|
||||||
|
# brightness keys) from the home-manager Sway config.
|
||||||
|
portable ? true,
|
||||||
}:
|
}:
|
||||||
nixpkgs.lib.nixosSystem {
|
nixpkgs.lib.nixosSystem {
|
||||||
inherit system;
|
inherit system;
|
||||||
specialArgs = { inherit inputs username fullName; };
|
specialArgs = {
|
||||||
|
inherit
|
||||||
|
inputs
|
||||||
|
username
|
||||||
|
fullName
|
||||||
|
portable
|
||||||
|
;
|
||||||
|
};
|
||||||
modules =
|
modules =
|
||||||
baseModules
|
baseModules
|
||||||
++ modules
|
++ modules
|
||||||
++ [
|
++ [
|
||||||
{
|
{
|
||||||
home-manager.extraSpecialArgs = { inherit inputs username fullName; };
|
home-manager.extraSpecialArgs = {
|
||||||
|
inherit
|
||||||
|
inputs
|
||||||
|
username
|
||||||
|
fullName
|
||||||
|
portable
|
||||||
|
;
|
||||||
|
};
|
||||||
home-manager.users.${username}.imports = homeModules;
|
home-manager.users.${username}.imports = homeModules;
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
@@ -163,6 +182,7 @@
|
|||||||
fullName = "Lyra Thorpe";
|
fullName = "Lyra Thorpe";
|
||||||
modules = [
|
modules = [
|
||||||
./system/machine/MBP-Asahi/configuration.nix
|
./system/machine/MBP-Asahi/configuration.nix
|
||||||
|
./system/modules/laptop.nix
|
||||||
nixos-apple-silicon.nixosModules.default
|
nixos-apple-silicon.nixosModules.default
|
||||||
./lyrathorpe/swaywm.nix
|
./lyrathorpe/swaywm.nix
|
||||||
];
|
];
|
||||||
@@ -178,6 +198,7 @@
|
|||||||
fullName = "Lyra Thorpe";
|
fullName = "Lyra Thorpe";
|
||||||
modules = [
|
modules = [
|
||||||
./system/machine/X1/configuration.nix
|
./system/machine/X1/configuration.nix
|
||||||
|
./system/modules/laptop.nix
|
||||||
./lyrathorpe/swaywm.nix
|
./lyrathorpe/swaywm.nix
|
||||||
];
|
];
|
||||||
homeModules = [
|
homeModules = [
|
||||||
|
|||||||
@@ -9,6 +9,7 @@
|
|||||||
ale
|
ale
|
||||||
vim-fugitive
|
vim-fugitive
|
||||||
vim-indent-guides
|
vim-indent-guides
|
||||||
|
catppuccin-vim
|
||||||
];
|
];
|
||||||
settings = {
|
settings = {
|
||||||
expandtab = false;
|
expandtab = false;
|
||||||
@@ -17,13 +18,10 @@
|
|||||||
};
|
};
|
||||||
extraConfig = ''
|
extraConfig = ''
|
||||||
let g:indent_guides_enable_on_vim_startup = 1
|
let g:indent_guides_enable_on_vim_startup = 1
|
||||||
if v:version < 802
|
|
||||||
packadd! peaksea
|
|
||||||
endif
|
|
||||||
syntax enable
|
syntax enable
|
||||||
colorscheme peaksea
|
|
||||||
set termguicolors
|
set termguicolors
|
||||||
set background=dark
|
set background=dark
|
||||||
|
colorscheme catppuccin_mocha
|
||||||
au BufNewFile,BufRead *Jenkinsfile setf groovy
|
au BufNewFile,BufRead *Jenkinsfile setf groovy
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -13,7 +13,6 @@
|
|||||||
plugins = [
|
plugins = [
|
||||||
"git"
|
"git"
|
||||||
"man"
|
"man"
|
||||||
"history-substring-search"
|
|
||||||
];
|
];
|
||||||
theme = "robbyrussell";
|
theme = "robbyrussell";
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -6,7 +6,14 @@
|
|||||||
# pulling a second Sway. home-manager owns the user config (~/.config/sway) and
|
# pulling a second Sway. home-manager owns the user config (~/.config/sway) and
|
||||||
# wires the systemd user session (sway-session.target), which is what lets the
|
# wires the systemd user session (sway-session.target), which is what lets the
|
||||||
# swayidle/dunst user services start with the desktop.
|
# swayidle/dunst user services start with the desktop.
|
||||||
{ pkgs, lib, ... }:
|
{
|
||||||
|
pkgs,
|
||||||
|
lib,
|
||||||
|
# Threaded from mkHost (flake.nix). Desktop hosts set this false to drop
|
||||||
|
# mobile components (battery block, screen-brightness keys).
|
||||||
|
portable ? true,
|
||||||
|
...
|
||||||
|
}:
|
||||||
{
|
{
|
||||||
wayland.windowManager.sway = {
|
wayland.windowManager.sway = {
|
||||||
enable = true;
|
enable = true;
|
||||||
@@ -42,15 +49,20 @@
|
|||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
keybindings = lib.mkOptionDefault {
|
keybindings = lib.mkOptionDefault (
|
||||||
|
{
|
||||||
"${modifier}+l" = "exec ${pkgs.swaylock}/bin/swaylock -f";
|
"${modifier}+l" = "exec ${pkgs.swaylock}/bin/swaylock -f";
|
||||||
"Print" = "exec ${pkgs.grim}/bin/grim ~/screenshot-$(date +%F-%H%M%S).png";
|
"Print" = "exec ${pkgs.grim}/bin/grim ~/screenshot-$(date +%F-%H%M%S).png";
|
||||||
"XF86MonBrightnessUp" = "exec ${pkgs.brightnessctl}/bin/brightnessctl set 5%+";
|
|
||||||
"XF86MonBrightnessDown" = "exec ${pkgs.brightnessctl}/bin/brightnessctl set 5%-";
|
|
||||||
"XF86AudioRaiseVolume" = "exec ${pkgs.wireplumber}/bin/wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+";
|
"XF86AudioRaiseVolume" = "exec ${pkgs.wireplumber}/bin/wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+";
|
||||||
"XF86AudioLowerVolume" = "exec ${pkgs.wireplumber}/bin/wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-";
|
"XF86AudioLowerVolume" = "exec ${pkgs.wireplumber}/bin/wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-";
|
||||||
"XF86AudioMute" = "exec ${pkgs.wireplumber}/bin/wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle";
|
"XF86AudioMute" = "exec ${pkgs.wireplumber}/bin/wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle";
|
||||||
};
|
}
|
||||||
|
# Screen backlight: laptops only (no internal backlight on a desktop).
|
||||||
|
// lib.optionalAttrs portable {
|
||||||
|
"XF86MonBrightnessUp" = "exec ${pkgs.brightnessctl}/bin/brightnessctl set 5%+";
|
||||||
|
"XF86MonBrightnessDown" = "exec ${pkgs.brightnessctl}/bin/brightnessctl set 5%-";
|
||||||
|
}
|
||||||
|
);
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -120,8 +132,20 @@
|
|||||||
block = "cpu";
|
block = "cpu";
|
||||||
interval = 2;
|
interval = 2;
|
||||||
}
|
}
|
||||||
{ block = "sound"; }
|
]
|
||||||
{ block = "battery"; }
|
# Desktop-only: CPU temperature and wired network throughput, in place
|
||||||
|
# of the laptop's battery readout.
|
||||||
|
++ lib.optionals (!portable) [
|
||||||
|
{
|
||||||
|
block = "temperature";
|
||||||
|
interval = 5;
|
||||||
|
format = " $icon $average avg, $max max ";
|
||||||
|
}
|
||||||
|
{ block = "net"; }
|
||||||
|
]
|
||||||
|
++ [ { block = "sound"; } ]
|
||||||
|
++ lib.optional portable { block = "battery"; }
|
||||||
|
++ [
|
||||||
{
|
{
|
||||||
block = "time";
|
block = "time";
|
||||||
interval = 5;
|
interval = 5;
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
{
|
{
|
||||||
config,
|
config,
|
||||||
lib,
|
lib,
|
||||||
options,
|
|
||||||
pkgs,
|
pkgs,
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
@@ -27,7 +26,7 @@ in
|
|||||||
export _JAVA_AWT_WM_NONREPARENTING=1
|
export _JAVA_AWT_WM_NONREPARENTING=1
|
||||||
# Misc
|
# Misc
|
||||||
export CLUTTER_BACKEND=wayland
|
export CLUTTER_BACKEND=wayland
|
||||||
export WINIT_UNIX_BACKEND=x11
|
export WINIT_UNIX_BACKEND=wayland
|
||||||
export MOZ_ENABLE_WAYLAND=1
|
export MOZ_ENABLE_WAYLAND=1
|
||||||
'';
|
'';
|
||||||
# Core Wayland utilities. The lock screen, idle daemon, status bar and
|
# Core Wayland utilities. The lock screen, idle daemon, status bar and
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
{
|
{
|
||||||
config,
|
config,
|
||||||
pkgs,
|
pkgs,
|
||||||
inputs,
|
|
||||||
lib,
|
lib,
|
||||||
username,
|
username,
|
||||||
fullName,
|
fullName,
|
||||||
|
|||||||
@@ -1,94 +1,26 @@
|
|||||||
# Edit this configuration file to define what should be installed on
|
# MacBook Pro (Apple Silicon, Asahi NixOS). Shared laptop options live in
|
||||||
# your system. Help is available in the configuration.nix(5) man page, on
|
# ../../modules/laptop.nix; only host-specific settings are here.
|
||||||
# https://search.nixos.org/options and in the NixOS manual (`nixos-help`).
|
{ pkgs, ... }:
|
||||||
|
|
||||||
{
|
|
||||||
config,
|
|
||||||
lib,
|
|
||||||
pkgs,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
|
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
# Include the results of the hardware scan.
|
|
||||||
./hardware-configuration.nix
|
./hardware-configuration.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
# Use the systemd-boot EFI boot loader.
|
# Asahi manages the EFI vars from macOS; do not touch them from NixOS.
|
||||||
boot.loader.systemd-boot.enable = true;
|
|
||||||
boot.loader.efi.canTouchEfiVariables = false;
|
boot.loader.efi.canTouchEfiVariables = false;
|
||||||
|
|
||||||
networking.hostName = "Emma-Asahi"; # Define your hostname.
|
networking.hostName = "Emma-Asahi";
|
||||||
# Pick only one of the below networking options.
|
|
||||||
# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
|
|
||||||
# networking.networkmanager.enable = true; # Easiest to use and most distros use this by default.
|
|
||||||
|
|
||||||
networking.wireless.iwd = {
|
# No fingerprint reader on this machine; empty service still lets swaylock
|
||||||
enable = true;
|
# authenticate via password.
|
||||||
settings.General.EnableNetworkConfiguration = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
# Set your time zone.
|
|
||||||
time.timeZone = "Europe/London";
|
|
||||||
|
|
||||||
# Configure network proxy if necessary
|
|
||||||
# networking.proxy.default = "http://user:password@proxy:port/";
|
|
||||||
# networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain";
|
|
||||||
|
|
||||||
# Select internationalisation properties.
|
|
||||||
i18n.defaultLocale = "en_GB.UTF-8";
|
|
||||||
console = {
|
|
||||||
# font = "Lat2-Terminus16";
|
|
||||||
keyMap = "dvorak";
|
|
||||||
# useXkbConfig = true; # use xkb.options in tty.
|
|
||||||
};
|
|
||||||
|
|
||||||
# Enable the X11 windowing system.
|
|
||||||
# services.xserver.enable = true;
|
|
||||||
|
|
||||||
features.swayDesktop.enable = true;
|
|
||||||
|
|
||||||
# Allow swaylock to authenticate (no fingerprint reader on this machine).
|
|
||||||
security.pam.services.swaylock = { };
|
security.pam.services.swaylock = { };
|
||||||
|
|
||||||
# Specify path to peripheral firmware files.
|
# Apple peripheral firmware (Wi-Fi/Bluetooth). The directory is gitignored and
|
||||||
|
# populated out-of-band -- see README.
|
||||||
hardware.asahi.peripheralFirmwareDirectory = ../../modules/firmware;
|
hardware.asahi.peripheralFirmwareDirectory = ../../modules/firmware;
|
||||||
|
|
||||||
# Configure keymap in X11
|
|
||||||
# services.xserver.xkb.layout = "us";
|
|
||||||
# services.xserver.xkb.options = "eurosign:e,caps:escape";
|
|
||||||
|
|
||||||
# Enable CUPS to print documents.
|
|
||||||
# services.printing.enable = true;
|
|
||||||
|
|
||||||
# Enable sound.
|
|
||||||
# services.pulseaudio.enable = true;
|
|
||||||
# OR
|
|
||||||
# services.pipewire = {
|
|
||||||
# enable = true;
|
|
||||||
# pulse.enable = true;
|
|
||||||
# };
|
|
||||||
|
|
||||||
# Enable touchpad support (enabled default in most desktopManager).
|
|
||||||
# services.libinput.enable = true;
|
|
||||||
|
|
||||||
# Define a user account. Don't forget to set a password with ‘passwd’.
|
|
||||||
# users.users.alice = {
|
|
||||||
# isNormalUser = true;
|
|
||||||
# extraGroups = [ "wheel" ]; # Enable ‘sudo’ for the user.
|
|
||||||
# packages = with pkgs; [
|
|
||||||
# tree
|
|
||||||
# ];
|
|
||||||
# };
|
|
||||||
|
|
||||||
# programs.firefox.enable = true;
|
|
||||||
|
|
||||||
# List packages installed in system profile. To search, run:
|
|
||||||
# $ nix search wget
|
|
||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = with pkgs; [
|
||||||
# wget
|
|
||||||
git
|
|
||||||
asahi-bless
|
asahi-bless
|
||||||
asahi-nvram
|
asahi-nvram
|
||||||
asahi-btsync
|
asahi-btsync
|
||||||
@@ -98,47 +30,6 @@
|
|||||||
iptables
|
iptables
|
||||||
];
|
];
|
||||||
|
|
||||||
# Some programs need SUID wrappers, can be configured further or are
|
# See `man configuration.nix` / the stateVersion docs before changing.
|
||||||
# started in user sessions.
|
system.stateVersion = "25.05";
|
||||||
# programs.mtr.enable = true;
|
|
||||||
# programs.gnupg.agent = {
|
|
||||||
# enable = true;
|
|
||||||
# enableSSHSupport = true;
|
|
||||||
# };
|
|
||||||
|
|
||||||
# List services that you want to enable:
|
|
||||||
|
|
||||||
# Enable the OpenSSH daemon.
|
|
||||||
# services.openssh.enable = true;
|
|
||||||
|
|
||||||
# Open ports in the firewall.
|
|
||||||
# networking.firewall.allowedTCPPorts = [ ... ];
|
|
||||||
# networking.firewall.allowedUDPPorts = [ ... ];
|
|
||||||
# Or disable the firewall altogether.
|
|
||||||
networking.firewall.enable = false;
|
|
||||||
|
|
||||||
# Copy the NixOS configuration file and link it from the resulting system
|
|
||||||
# (/run/current-system/configuration.nix). This is useful in case you
|
|
||||||
# accidentally delete configuration.nix.
|
|
||||||
#system.copySystemConfiguration = true;
|
|
||||||
|
|
||||||
# This option defines the first version of NixOS you have installed on this particular machine,
|
|
||||||
# and is used to maintain compatibility with application data (e.g. databases) created on older NixOS versions.
|
|
||||||
#
|
|
||||||
# Most users should NEVER change this value after the initial install, for any reason,
|
|
||||||
# even if you've upgraded your system to a new NixOS release.
|
|
||||||
#
|
|
||||||
# This value does NOT affect the Nixpkgs version your packages and OS are pulled from,
|
|
||||||
# so changing it will NOT upgrade your system - see https://nixos.org/manual/nixos/stable/#sec-upgrading for how
|
|
||||||
# to actually do that.
|
|
||||||
#
|
|
||||||
# This value being lower than the current NixOS release does NOT mean your system is
|
|
||||||
# out of date, out of support, or vulnerable.
|
|
||||||
#
|
|
||||||
# Do NOT change this value unless you have manually inspected all the changes it would make to your configuration,
|
|
||||||
# and migrated your data accordingly.
|
|
||||||
#
|
|
||||||
# For more information, see `man configuration.nix` or https://nixos.org/manual/nixos/stable/options#opt-system.stateVersion .
|
|
||||||
system.stateVersion = "25.05"; # Did you read the comment?
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,134 +1,33 @@
|
|||||||
# Edit this configuration file to define what should be installed on
|
# ThinkPad X1 (NixOS). Shared laptop options live in ../../modules/laptop.nix;
|
||||||
# your system. Help is available in the configuration.nix(5) man page, on
|
# only host-specific settings are here.
|
||||||
# https://search.nixos.org/options and in the NixOS manual (`nixos-help`).
|
{ ... }:
|
||||||
|
|
||||||
{
|
|
||||||
config,
|
|
||||||
lib,
|
|
||||||
pkgs,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
|
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
# Include the results of the hardware scan.
|
|
||||||
./hardware-configuration.nix
|
./hardware-configuration.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
# Use the systemd-boot EFI boot loader.
|
|
||||||
boot.loader.systemd-boot.enable = true;
|
|
||||||
boot.loader.efi.canTouchEfiVariables = true;
|
boot.loader.efi.canTouchEfiVariables = true;
|
||||||
|
|
||||||
networking.hostName = "X1-NixOS"; # Define your hostname.
|
networking.hostName = "X1-NixOS";
|
||||||
networking.domain = "client.cbg.emmaisvery.gay";
|
networking.domain = "client.cbg.emmaisvery.gay";
|
||||||
features.swayDesktop.enable = true;
|
|
||||||
# Pick only one of the below networking options.
|
|
||||||
networking.wireless.iwd = {
|
|
||||||
enable = true;
|
|
||||||
settings.General.EnableNetworkConfiguration = true;
|
|
||||||
};
|
|
||||||
# networking.networkmanager.enable = true; # Easiest to use and most distros use this by default.
|
|
||||||
|
|
||||||
# Set your time zone.
|
console.font = "Lat2-Terminus16";
|
||||||
time.timeZone = "Europe/London";
|
|
||||||
|
|
||||||
# Configure network proxy if necessary
|
|
||||||
# networking.proxy.default = "http://user:password@proxy:port/";
|
|
||||||
# networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain";
|
|
||||||
|
|
||||||
# Select internationalisation properties.
|
|
||||||
i18n.defaultLocale = "en_GB.UTF-8";
|
|
||||||
console = {
|
|
||||||
font = "Lat2-Terminus16";
|
|
||||||
keyMap = "dvorak";
|
|
||||||
# useXkbConfig = true; # use xkb.options in tty.
|
|
||||||
};
|
|
||||||
|
|
||||||
# Enable the X11 windowing system.
|
|
||||||
# services.xserver.enable = true;
|
|
||||||
|
|
||||||
# Configure keymap in X11
|
|
||||||
# services.xserver.xkb.layout = "us";
|
|
||||||
# services.xserver.xkb.options = "eurosign:e,caps:escape";
|
|
||||||
|
|
||||||
# Enable CUPS to print documents.
|
|
||||||
# services.printing.enable = true;
|
|
||||||
|
|
||||||
# Enable sound.
|
|
||||||
# hardware.pulseaudio.enable = true;
|
|
||||||
# OR
|
|
||||||
services.pipewire = {
|
services.pipewire = {
|
||||||
enable = true;
|
enable = true;
|
||||||
pulse.enable = true;
|
pulse.enable = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
# Enable touchpad support (enabled default in most desktopManager).
|
# This host accepts SSH, so open 22 (the firewall itself is enabled in
|
||||||
# services.libinput.enable = true;
|
# laptop.nix with a default-deny policy).
|
||||||
|
|
||||||
# Define a user account. Don't forget to set a password with ‘passwd’.
|
|
||||||
# users.users.alice = {
|
|
||||||
# isNormalUser = true;
|
|
||||||
# extraGroups = [ "wheel" ]; # Enable ‘sudo’ for the user.
|
|
||||||
# packages = with pkgs; [
|
|
||||||
# tree
|
|
||||||
# ];
|
|
||||||
# };
|
|
||||||
|
|
||||||
# List packages installed in system profile. To search, run:
|
|
||||||
# $ nix search wget
|
|
||||||
environment.systemPackages = with pkgs; [
|
|
||||||
git
|
|
||||||
fastfetch
|
|
||||||
# wget
|
|
||||||
];
|
|
||||||
|
|
||||||
# Some programs need SUID wrappers, can be configured further or are
|
|
||||||
# started in user sessions.
|
|
||||||
# programs.mtr.enable = true;
|
|
||||||
# programs.gnupg.agent = {
|
|
||||||
# enable = true;
|
|
||||||
# enableSSHSupport = true;
|
|
||||||
# };
|
|
||||||
|
|
||||||
# List services that you want to enable:
|
|
||||||
|
|
||||||
# Enable the OpenSSH daemon.
|
|
||||||
services.openssh.enable = true;
|
services.openssh.enable = true;
|
||||||
|
networking.firewall.allowedTCPPorts = [ 22 ];
|
||||||
|
|
||||||
# Open ports in the firewall.
|
# Fingerprint reader: allow swaylock to authenticate via fprintd.
|
||||||
# networking.firewall.allowedTCPPorts = [ ... ];
|
|
||||||
# networking.firewall.allowedUDPPorts = [ ... ];
|
|
||||||
# Or disable the firewall altogether.
|
|
||||||
networking.firewall.enable = false;
|
|
||||||
|
|
||||||
# Copy the NixOS configuration file and link it from the resulting system
|
|
||||||
# (/run/current-system/configuration.nix). This is useful in case you
|
|
||||||
# accidentally delete configuration.nix.
|
|
||||||
#system.copySystemConfiguration = true;
|
|
||||||
|
|
||||||
# This option defines the first version of NixOS you have installed on this particular machine,
|
|
||||||
# and is used to maintain compatibility with application data (e.g. databases) created on older NixOS versions.
|
|
||||||
#
|
|
||||||
# Most users should NEVER change this value after the initial install, for any reason,
|
|
||||||
# even if you've upgraded your system to a new NixOS release.
|
|
||||||
#
|
|
||||||
# This value does NOT affect the Nixpkgs version your packages and OS are pulled from,
|
|
||||||
# so changing it will NOT upgrade your system - see https://nixos.org/manual/nixos/stable/#sec-upgrading for how
|
|
||||||
# to actually do that.
|
|
||||||
#
|
|
||||||
# This value being lower than the current NixOS release does NOT mean your system is
|
|
||||||
# out of date, out of support, or vulnerable.
|
|
||||||
#
|
|
||||||
# Do NOT change this value unless you have manually inspected all the changes it would make to your configuration,
|
|
||||||
# and migrated your data accordingly.
|
|
||||||
#
|
|
||||||
# For more information, see `man configuration.nix` or https://nixos.org/manual/nixos/stable/options#opt-system.stateVersion .
|
|
||||||
system.stateVersion = "24.11"; # Did you read the comment?
|
|
||||||
|
|
||||||
# TODO: Move to fprint security module to import anywhere
|
|
||||||
services.fprintd.enable = true;
|
services.fprintd.enable = true;
|
||||||
security.pam.services.swaylock = {
|
security.pam.services.swaylock.fprintAuth = true;
|
||||||
fprintAuth = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
# See `man configuration.nix` / the stateVersion docs before changing.
|
||||||
|
system.stateVersion = "24.11";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,15 @@
|
|||||||
|
# Options shared by every NixOS host (laptops and the WSL box). Imported via
|
||||||
|
# baseModules in flake.nix. Host- and platform-specific settings stay in the
|
||||||
|
# per-machine configs; laptop-only settings live in ./laptop.nix.
|
||||||
|
{ pkgs, ... }:
|
||||||
|
{
|
||||||
|
time.timeZone = "Europe/London";
|
||||||
|
i18n.defaultLocale = "en_GB.UTF-8";
|
||||||
|
|
||||||
|
# Minimal system-level CLI available before the home-manager profile loads
|
||||||
|
# (e.g. early boot / rescue). User-level tooling lives in home-manager.
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
git
|
||||||
|
fastfetch
|
||||||
|
];
|
||||||
|
}
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
# Desktop (non-portable) NixOS hosts. Counterpart to ./laptop.nix: imports the
|
||||||
|
# shared ./workstation.nix base and swaps the mobile Wi-Fi backend for wired
|
||||||
|
# NetworkManager. A desktop host also sets `portable = false` in its host-table
|
||||||
|
# entry (flake.nix), which drops the battery block and brightness keybindings
|
||||||
|
# from the Sway bar -- see lyrathorpe/home/sway.nix.
|
||||||
|
{ ... }:
|
||||||
|
{
|
||||||
|
imports = [ ./workstation.nix ];
|
||||||
|
|
||||||
|
# Wired networking. NetworkManager handles DHCP/connections itself; do not
|
||||||
|
# combine with networking.wireless.* (laptop.nix) -- the two backends conflict.
|
||||||
|
networking.networkmanager.enable = true;
|
||||||
|
}
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
# Portable NixOS hosts (X1, MBP-Asahi). Imported from the host table in
|
||||||
|
# flake.nix. Shared graphical-workstation settings live in ./workstation.nix;
|
||||||
|
# the only laptop-specific bit is the Wi-Fi backend. Mobile home-manager
|
||||||
|
# components (battery block, brightness keys) are gated by the `portable` flag
|
||||||
|
# threaded through mkHost -- see lyrathorpe/home/sway.nix.
|
||||||
|
{ ... }:
|
||||||
|
{
|
||||||
|
imports = [ ./workstation.nix ];
|
||||||
|
|
||||||
|
# Wi-Fi via iwd with its built-in DHCP/network configuration.
|
||||||
|
networking.wireless.iwd = {
|
||||||
|
enable = true;
|
||||||
|
settings.General.EnableNetworkConfiguration = true;
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -1,10 +1,4 @@
|
|||||||
{
|
{ pkgs, ... }:
|
||||||
config,
|
|
||||||
pkgs,
|
|
||||||
inputs,
|
|
||||||
lib,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
|
|
||||||
{
|
{
|
||||||
programs.git = {
|
programs.git = {
|
||||||
|
|||||||
@@ -0,0 +1,15 @@
|
|||||||
|
# Form-factor-agnostic base for the physical graphical NixOS machines. Imported
|
||||||
|
# by both ./laptop.nix and ./desktop.nix; those add only the bits that differ
|
||||||
|
# between portable and desktop hosts (chiefly the networking backend).
|
||||||
|
{ ... }:
|
||||||
|
{
|
||||||
|
boot.loader.systemd-boot.enable = true;
|
||||||
|
|
||||||
|
features.swayDesktop.enable = true;
|
||||||
|
|
||||||
|
console.keyMap = "dvorak";
|
||||||
|
|
||||||
|
# Default-deny inbound. Hosts that run a listening service open their own
|
||||||
|
# ports next to where the service is enabled (e.g. sshd -> 22 on X1).
|
||||||
|
networking.firewall.enable = true;
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user