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
16 changes: 16 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

48 changes: 45 additions & 3 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
# Specify the source of Home Manager and Nixpkgs.
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
nvim-configuration.url = "github:c3n21/nvim-configuration/develop";
nixos-facter-modules.url = "github:numtide/nixos-facter-modules";
# https://github.com/hyprwm/Hyprland/issues/5891
# https://github.com/NixOS/nix/issues/6633
hyprland = {
Expand Down Expand Up @@ -53,14 +54,15 @@
outputs =
{
self,
nixpkgs,
disko,
home-manager,
nixos-hardware,
lanzaboote,
niri,
nixos-hardware,
nixos-wsl,
disko,
noctalia,
nixpkgs,
nixos-facter-modules,
...
}@inputs:
let
Expand Down Expand Up @@ -90,6 +92,46 @@
];

nixosConfigurations = {
hp-probook = nixpkgs.lib.nixosSystem {
inherit system pkgs;

specialArgs = {
inherit inputs outputs;
};

modules = [
nixos-facter-modules.nixosModules.facter
disko.nixosModules.disko
lanzaboote.nixosModules.lanzaboote
home-manager.nixosModules.home-manager

homeManagerModuleConfiguration

./nixos/hp-probook/configuration.nix

{
home-manager.users.zhifan = ./home-manager/home.nix;
}

{
home-manager.users.zhifan = ./home-manager/linux/packages-profiles/gaming.nix;
}

{

# home-manager modules must be put there
home-manager.users.zhifan.imports = [
inputs.niri.homeModules.niri
inputs.noctalia.homeModules.default
];
}

{
home-manager.users.zhifan = ./home-manager/linux;
}
];
};

framework-13-7040-amd = nixpkgs.lib.nixosSystem {
inherit system pkgs;

Expand Down
129 changes: 129 additions & 0 deletions nixos/hp-probook/configuration.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
# Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running ‘nixos-help’).
# Common configuration for all machines
{ pkgs, ... }:
{

imports = [
./disko.nix
./facter.nix

# common
# ../common/distributed-builds.nix
../common/fish.nix
# ../common/secure-boot.nix
../common/editor.nix
../common/nix.nix

../desktop.nix
../firewall.nix

../modules/niri.nix
];

# loader = {
# systemd-boot.enable = true;
# };

boot.loader.systemd-boot.enable = true;

services.thermald.enable = true;
hardware.cpu.intel.updateMicrocode = true;

networking = {
hostName = "kenjy"; # Define your hostname.
hostId = "5cca6037";
};

boot = {
kernelPackages = pkgs.linuxKernel.packages.linux_zen;
zfs.package = pkgs.zfs_2_4;
};

hardware = {
graphics = {
enable = true;
enable32Bit = true;
extraPackages32 = with pkgs.driversi686Linux; [
intel-vaapi-driver
intel-media-driver
];
extraPackages = with pkgs; [
vpl-gpu-rt
intel-vaapi-driver
intel-media-driver
];
};
};

# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.

# Configure network proxy if necessary
# networking.proxy.default = "http://user:password@proxy:port/";
# networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain";

# Set your time zone.
time.timeZone = "Europe/Rome";

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

# home-manager.users.zhifan = {
# /* The home.stateVersion option does not have a default and must be set */
# home.stateVersion = "23.05";
# /* Here goes the rest of your home-manager config, e.g. home.packages = [ pkgs.foo ]; */
# };

# services.udev.extraRules = ''
# ACTION=="add", SUBSYSTEM=="backlight", KERNEL=="intel_backlight", MODE="0666", RUN+="${pkgs.coreutils}/bin/chmod a+w /sys/class/backlight/%k/brightness"
# '';

# xsession.pointerCursor = {
# package = pkgs.gnome3.defaultIconTheme;
# name = "Adwaita";
# size = 130;
# };

# 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;

users.users = {
root.openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOXsckYz+HIMA2eJtUfyKtjTOQxHt3hW4qrycpLqS/qX hp"
];
};

services.power-profiles-daemon.enable = true;

# Open ports in the firewall.
# networking.firewall.allowedTCPPorts = [ ... ];
# networking.firewall.allowedUDPPorts = [ ... ];
# Or disable the firewall altogether.
# networking.firewall.enable = false;

# This value determines the NixOS release from which the default
# settings for stateful data, like file locations and database versions
# on your system were taken. It‘s perfectly fine and recommended to leave
# this value at the release version of the first install of this system.
# Before changing this value read the documentation for this option
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
system.stateVersion = "25.11"; # Did you read the comment?

# TODO: eventually put this in a module
home-manager.users.zhifan = {
home.sessionVariables = {
NUGET_PLUGIN_PATHS = "${pkgs.azure-artifacts-credprovider}/lib/azure-artifacts-credprovider/CredentialProvider.Microsoft.dll";
};
};
}
79 changes: 79 additions & 0 deletions nixos/hp-probook/disko.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
{
boot = {
zfs = {
requestEncryptionCredentials = true;

forceImportRoot = false;
};
supportedFilesystems = [
"zfs"
]; # Enable ZFS support
};

disko.devices = {
disk = {
x = {
type = "disk";
device = "/dev/disk/by-id/usb-Samsung_PSSD_T7_S6XDNS0W648443R-0:0";
content = {
type = "gpt";
partitions = {
ESP = {
size = "64M";
type = "EF00";
content = {
type = "filesystem";
format = "vfat";
mountpoint = "/boot";
mountOptions = [ "umask=0077" ];
};
};

swap = {
size = "64G";
content = {
type = "swap";
resumeDevice = true; # resume from hiberation from this device
};
};

zfs = {
size = "100%";
content = {
type = "zfs";
pool = "zroot";
};
};
};
};
};
};
zpool = {
zroot = {
type = "zpool";
datasets = {
"root" = {
type = "zfs_fs";
options = {
encryption = "aes-256-gcm";
keyformat = "passphrase";
keylocation = "prompt";
};
mountpoint = "/";
};
};
options = {
# Workaround: cannot import 'zroot': I/O error in disko tests
cachefile = "none";
};
rootFsOptions = {
compression = "zstd";
"com.sun:auto-snapshot" = "false";
};
postCreateHook = # bash
"zfs list -t snapshot -H -o name | grep -E '^zroot@blank$' || zfs snapshot zroot@blank";
};
};
};

}
Loading