Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
use flake
22 changes: 22 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Test CI

on:
push:
branches:
- main
pull_request:

jobs:
test-flake:
name: "Test flake options"
runs-on: ubuntu-latest

steps:
- name: Check out the repository
uses: actions/checkout@v7

- name: Lix GHA Installer Action
uses: samueldr/lix-gha-installer-action@v2026-06-15

- name: Check up flake configuration
run: nix flake check --system x86_64-linux --show-trace
31 changes: 31 additions & 0 deletions checks/biosboot/configuration.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
pkgs,
...
}:
{
networking.hostName = "snow";

# Select internationalisation properties.
i18n.defaultLocale = "en_US.UTF-8";

console.useXkbConfig = true;

users.users."test" = {
isNormalUser = true;
description = "test user";
extraGroups = [
"wheel"
"networkmanager"
];
};

# Allow unfree packages
nixpkgs.config.allowUnfree = true;

# List packages installed in system profile.
environment.systemPackages = with pkgs; [
htop
];

system.stateVersion = "26.05";
}
43 changes: 43 additions & 0 deletions checks/biosboot/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# source: https://discourse.nixos.org/t/nixostest-with-flake-configurations/11542/5
{
inputs,
pkgs,
...
}:
pkgs.testers.runNixOSTest {
name = "Efiboot config test";

nodes.machine =
{ ... }:
{
imports = with inputs.self; [
nixosModules.biosboot
nixosModules.gnome
nixosModules.kernel
nixosModules.metadata
nixosModules.networking
nixosModules.packagemanagers
nixosModules.pipewire
nixosModules.printing
nixosModules.snowflakeos
./configuration.nix
];
};

node = {
# since we are using an overlay, we must make pkgs writable
pkgsReadOnly = false;

specialArgs = { inherit inputs; };
};

# disable only when working on testScript
skipTypeCheck = true;

testScript = ''
machine.start()
machine.wait_for_unit("multi-user.target")
machine.succeed("uname -a")
machine.succeed("echo Modules succesfully tested")
'';
}
31 changes: 31 additions & 0 deletions checks/efiboot/configuration.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
pkgs,
...
}:
{
networking.hostName = "snow";

# Select internationalisation properties.
i18n.defaultLocale = "en_US.UTF-8";

console.useXkbConfig = true;

users.users."test" = {
isNormalUser = true;
description = "test user";
extraGroups = [
"wheel"
"networkmanager"
];
};

# Allow unfree packages
nixpkgs.config.allowUnfree = true;

# List packages installed in system profile.
environment.systemPackages = with pkgs; [
htop
];

system.stateVersion = "26.05";
}
43 changes: 43 additions & 0 deletions checks/efiboot/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# source: https://discourse.nixos.org/t/nixostest-with-flake-configurations/11542/5
{
inputs,
pkgs,
...
}:
pkgs.testers.runNixOSTest {
name = "Efiboot config test";

nodes.machine =
{ ... }:
{
imports = with inputs.self; [
nixosModules.efiboot
nixosModules.gnome
nixosModules.kernel
nixosModules.metadata
nixosModules.networking
nixosModules.packagemanagers
nixosModules.pipewire
nixosModules.printing
nixosModules.snowflakeos
./configuration.nix
];
};

node = {
# since we are using an overlay, we must make pkgs writable
pkgsReadOnly = false;

specialArgs = { inherit inputs; };
};

# disable only when working on testScript
skipTypeCheck = true;

testScript = ''
machine.start()
machine.wait_for_unit("multi-user.target")
machine.succeed("uname -a")
machine.succeed("echo Modules succesfully tested")
'';
}
11 changes: 10 additions & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,19 @@
};
};

outputs = inputs:
outputs =
inputs:
inputs.snowfall-lib.mkFlake {
inherit inputs;
channels-config.allowUnfree = true;
src = ./.;

# Extra nix flags to set
outputs-builder = channels: {
formatter = channels.nixpkgs.nixfmt-tree;
};

# Default shell environment
alias.shells.default = "default";
};
}
8 changes: 7 additions & 1 deletion modules/nixos/biosboot/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
{ options, config, lib, pkgs, ... }:
{
options,
config,
lib,
pkgs,
...
}:

with lib;
let
Expand Down
29 changes: 19 additions & 10 deletions modules/nixos/efiboot/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
{ options, config, lib, pkgs, ... }:
{
options,
config,
lib,
pkgs,
...
}:

with lib;
let
Expand All @@ -8,19 +14,21 @@ in
{
options.modules.efiboot = with types; {
bootloader = mkOption {
type = enum [ "grub" "systemd-boot" ];
type = enum [
"grub"
"systemd-boot"
];
default = "systemd-boot";
description = "The kernel to use for booting.";
};
};

config = mkMerge [
(mkIf (cfg.bootloader == "systemd-boot")
{
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
boot.loader.systemd-boot.editor = mkDefault false;
})
(mkIf (cfg.bootloader == "systemd-boot") {
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
boot.loader.systemd-boot.editor = mkDefault false;
})
(mkIf (cfg.bootloader == "grub") {
boot.loader.systemd-boot.enable = false;
boot.loader.grub.enable = true;
Expand All @@ -31,8 +39,9 @@ in
{
boot.tmp.cleanOnBoot = mkDefault true;
# Temporary workaround for "random seed file is world accessible"
fileSystems.${efiSysMountPoint}.options =
mkIf (config.fileSystems.${efiSysMountPoint}.fsType == "vfat") [ "umask=0077" ];
fileSystems.${efiSysMountPoint}.options = mkIf (
config.fileSystems.${efiSysMountPoint}.fsType == "vfat"
) [ "umask=0077" ];
}
];
}
61 changes: 34 additions & 27 deletions modules/nixos/gnome/default.nix
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
{ options, config, lib, pkgs, ... }:
{
options,
config,
lib,
pkgs,
...
}:

with lib;
let
cfg = config.modules.gnome;
in
{
options.modules.gnome = with types; {
gsconnect.enable =
mkEnableOption "Enable KDE Connect integration";
removeUtils.enable =
mkEnableOption "Remove non-essential GNOME utilities";
gsconnect.enable = mkEnableOption "Enable KDE Connect integration";
removeUtils.enable = mkEnableOption "Remove non-essential GNOME utilities";
};

config = {
Expand All @@ -33,27 +37,30 @@ in
enable = true;
};

environment.gnome.excludePackages = mkIf cfg.removeUtils.enable (with pkgs.gnome; [
baobab
cheese
eog
epiphany
file-roller
gnome-calculator
gnome-calendar
gnome-characters
gnome-clocks
gnome-contacts
gnome-font-viewer
gnome-logs
gnome-maps
gnome-music
gnome-weather
pkgs.gnome-connections
pkgs.gnome-photos
pkgs.gnome-text-editor
simple-scan
totem
]);
environment.gnome.excludePackages = mkIf cfg.removeUtils.enable (
with pkgs.gnome;
[
baobab
cheese
eog
epiphany
file-roller
gnome-calculator
gnome-calendar
gnome-characters
gnome-clocks
gnome-contacts
gnome-font-viewer
gnome-logs
gnome-maps
gnome-music
gnome-weather
pkgs.gnome-connections
pkgs.gnome-photos
pkgs.gnome-text-editor
simple-scan
totem
]
);
};
}
7 changes: 6 additions & 1 deletion modules/nixos/kernel/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
{ config, lib, pkgs, ... }:
{
config,
lib,
pkgs,
...
}:
with lib;
{
config = {
Expand Down
12 changes: 10 additions & 2 deletions modules/nixos/networking/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
{ config, lib, pkgs, ... }:
{
config,
lib,
pkgs,
...
}:
with lib;
{
config = {
Expand All @@ -7,7 +12,10 @@ with lib;
# Workaround for https://github.com/NixOS/nixpkgs/issues/180175
systemd.services.NetworkManager-wait-online = {
serviceConfig = {
ExecStart = [ "" "${pkgs.networkmanager}/bin/nm-online -q" ];
ExecStart = [
""
"${pkgs.networkmanager}/bin/nm-online -q"
];
};
};
};
Expand Down
11 changes: 8 additions & 3 deletions modules/nixos/packagemanagers/default.nix
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
{ options, config, lib, pkgs, ... }:
{
options,
config,
lib,
pkgs,
...
}:

with lib;
let
cfg = config.modules.packagemanagers;
in
{
options.modules.packagemanagers = with types; {
appimage.enable =
mkEnableOption "Enable AppImage";
appimage.enable = mkEnableOption "Enable AppImage";
};

config = mkIf cfg.appimage.enable {
Expand Down
Loading
Loading