Merge remote-tracking branch 'refs/remotes/origin/main'

This commit is contained in:
xenia 2024-07-03 18:58:42 +02:00
commit 728f7e7ce2
11 changed files with 242 additions and 43 deletions

View File

@ -21,6 +21,21 @@
"url": "https://git@githug.xyz/xenia/ansi-utils" "url": "https://git@githug.xyz/xenia/ansi-utils"
} }
}, },
"flake-compat": {
"locked": {
"lastModified": 1688025799,
"narHash": "sha256-ktpB4dRtnksm9F5WawoIkEneh1nrEvuxb5lJFt1iOyw=",
"owner": "nix-community",
"repo": "flake-compat",
"rev": "8bf105319d44f6b9f0d764efa4fdef9f1cc9ba1c",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "flake-compat",
"type": "github"
}
},
"flake-utils": { "flake-utils": {
"inputs": { "inputs": {
"systems": "systems" "systems": "systems"
@ -155,6 +170,28 @@
"type": "github" "type": "github"
} }
}, },
"nixos-apple-silicon": {
"inputs": {
"flake-compat": "flake-compat",
"nixpkgs": [
"nixpkgs"
],
"rust-overlay": "rust-overlay"
},
"locked": {
"lastModified": 1718588737,
"narHash": "sha256-06acqoMEYtc+/w5gWiIIuUFfdtdOBKlp1qrC/InRiBY=",
"owner": "tpwrules",
"repo": "nixos-apple-silicon",
"rev": "b0a2376f6c164a0af963d47386c064cc6fdcd5ea",
"type": "github"
},
"original": {
"owner": "tpwrules",
"repo": "nixos-apple-silicon",
"type": "github"
}
},
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1717144377, "lastModified": 1717144377,
@ -177,11 +214,28 @@
"home-manager": "home-manager", "home-manager": "home-manager",
"kak": "kak", "kak": "kak",
"nix-darwin": "nix-darwin", "nix-darwin": "nix-darwin",
"nixos-apple-silicon": "nixos-apple-silicon",
"nixpkgs": "nixpkgs", "nixpkgs": "nixpkgs",
"unambig-path": "unambig-path", "unambig-path": "unambig-path",
"unispect": "unispect" "unispect": "unispect"
} }
}, },
"rust-overlay": {
"flake": false,
"locked": {
"lastModified": 1686795910,
"narHash": "sha256-jDa40qRZ0GRQtP9EMZdf+uCbvzuLnJglTUI2JoHfWDc=",
"owner": "oxalica",
"repo": "rust-overlay",
"rev": "5c2b97c0a9bc5217fc3dfb1555aae0fb756d99f9",
"type": "github"
},
"original": {
"owner": "oxalica",
"repo": "rust-overlay",
"type": "github"
}
},
"systems": { "systems": {
"locked": { "locked": {
"lastModified": 1681028828, "lastModified": 1681028828,

View File

@ -29,9 +29,13 @@
url = "git+https://git@githug.xyz/xenia/unambig-path"; url = "git+https://git@githug.xyz/xenia/unambig-path";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
nixos-apple-silicon = {
url = "github:tpwrules/nixos-apple-silicon";
inputs.nixpkgs.follows = "nixpkgs";
};
}; };
outputs = { self, nixpkgs, home-manager, nix-darwin, kak, unispect, ansi-utils, unambig-path }: outputs = { self, nixpkgs, home-manager, nix-darwin, kak, unispect, ansi-utils, unambig-path, nixos-apple-silicon }:
let let
mkPkgs = system: import nixpkgs { system = system; config.allowUnfree = true; }; mkPkgs = system: import nixpkgs { system = system; config.allowUnfree = true; };
mkHome = {username, home-dir, prompt-color, system, pkgs} : import ./home/common.nix { mkHome = {username, home-dir, prompt-color, system, pkgs} : import ./home/common.nix {
@ -96,17 +100,13 @@
base = mkNixOsBase { base = mkNixOsBase {
inherit system pkgs; inherit system pkgs;
hostname = "catboy-cafe"; hostname = "catboy-cafe";
use-efi = true;
}; };
graphical = mkNixOsGraphical { graphical = mkNixOsGraphical {
inherit pkgs; inherit pkgs;
background = "pan-wire-3.png"; background = "pan-wire-3.png";
use-display-manager = false;
}; };
networking = mkNixOsNetworking { networking = mkNixOsNetworking { inherit pkgs; };
inherit pkgs;
eth-interface = "enp0s31f6";
static-ip = "192.168.0.199";
};
coral = coral =
let let
@ -136,7 +136,8 @@
nixpkgs.lib.nixosSystem { nixpkgs.lib.nixosSystem {
inherit system; inherit system;
modules = [ modules = [
./nixos/hardware/catboy-cafe.nix ./nixos/machines/catboy-cafe/hardware.nix
./nixos/machines/catboy-cafe/boot.nix
base base
graphical graphical
networking networking
@ -150,5 +151,73 @@
{ home-manager.users.xenia = xenia.pc; } { home-manager.users.xenia = xenia.pc; }
]; ];
}; };
nixosConfigurations.foxhut =
let
system = "aarch64-linux";
pkgs = mkPkgs system;
base = mkNixOsBase {
inherit system pkgs;
hostname = "foxhut";
};
networking = mkNixOsNetworking {
inherit pkgs;
use-iwd = true;
};
graphical = mkNixOsGraphical {
inherit pkgs;
background = "pan-wire-3.png";
use-display-manager = true;
};
coral =
let
system = "aarch64-linux";
pkgs = mkPkgs system;
home = mkHome {
username = "coral";
home-dir = "/home/coral";
prompt-color = 243;
inherit system pkgs;
};
in { home = home; };
xenia =
let
system = "aarch64-linux";
pkgs = mkPkgs system;
home = mkHome {
username = "xenia";
home-dir = "/home/xenia";
prompt-color = 205;
inherit system pkgs;
};
pc = mkPC { inherit system pkgs; };
in { home = home; pc = pc; };
asahi-firmware = builtins.fetchGit {
url = "git@githug.xyz:xenia/asahi-firmware.git";
ref = "main";
rev = "012d29d4b4d7148414bb649c39805479c7a4327b";
};
tiny-dfr = import ./nixos/tiny-dfr.nix { inherit pkgs; };
in
nixpkgs.lib.nixosSystem {
inherit system;
modules = [
nixos-apple-silicon.nixosModules.apple-silicon-support
./nixos/machines/foxhut/hardware.nix
(import ./nixos/machines/foxhut/boot.nix { inherit asahi-firmware; })
base
networking
graphical
tiny-dfr
home-manager.nixosModules.home-manager
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users.coral = coral.home;
home-manager.users.xenia = xenia.home;
}
{ home-manager.users.xenia = xenia.pc; }
];
};
}; };
} }

View File

@ -20,7 +20,10 @@ let
in rec { in rec {
home.packages = with pkgs; [ home.packages = with pkgs; [
fira-code ibm-plex fira-code ibm-plex
] ++ (if pkgs.stdenv.isDarwin then [alloy6-mac] else [pkgs.alloy6]); ]
++ (if pkgs.stdenv.isDarwin then [alloy6-mac] else [pkgs.alloy6])
++ (if pkgs.stdenv.isDarwin then [] else [pkgs.keepassxc])
;
programs.alacritty = alacritty; programs.alacritty = alacritty;
} }

View File

@ -1,7 +1,5 @@
{ {
system, pkgs, nixpkgs-flake, hostname, system, pkgs, nixpkgs-flake, hostname,
use-efi ? false, efi-mountpoint ? "/boot",
use-grub ? false, grub-device ? "/dev/sda",
}: }:
{ {
nixpkgs.config.allowUnfree = true; # lol nixpkgs.config.allowUnfree = true; # lol
@ -29,17 +27,6 @@
networking.hostName = hostname; networking.hostName = hostname;
boot.loader = if use-efi
then {
systemd-boot.enable = true;
efi.canTouchEfiVariables = true;
efi.efiSysMountPoint = efi-mountpoint;
} else if use-grub then {
grub.enable = true;
grub.devce = grub-device;
} else throw "Please use either use-efi or use-grub = true";
time.timeZone = "Europe/Stockholm"; time.timeZone = "Europe/Stockholm";
services.logind.lidSwitch = "ignore"; services.logind.lidSwitch = "ignore";

View File

@ -1,14 +1,18 @@
{ {
pkgs, pkgs,
background-image ? "pan-wire-3.png", background-image ? "pan-wire-3.png",
use-display-manager,
... ...
}: }:
let start-plasma-shortcut = pkgs.writeScriptBin "desktop" ''
${pkgs.plasma-workspace}/libexec/plasma-dbus-run-session-if-needed ${pkgs.plasma-workspace}/bin/startplasma-wayland
'';
in
{ {
# Enable the X11 windowing system.
services.xserver = { services.xserver = {
enable = true; enable = true;
displayManager.lightdm.enable = true;
displayManager.lightdm.enable = use-display-manager;
xkb = { xkb = {
layout = "fox"; layout = "fox";
@ -25,11 +29,18 @@
services.desktopManager.plasma6.enable = true; services.desktopManager.plasma6.enable = true;
services.displayManager.defaultSession = "plasma"; services.displayManager.defaultSession = "plasma";
hardware.opengl.enable = true;
console.useXkbConfig = true; console.useXkbConfig = true;
# Enable sound. sound.enable = false; # let pipewire handle sound
sound.enable = true; services.pipewire = {
hardware.pulseaudio.enable = true; enable = true;
alsa.enable = true;
pulse.enable = true;
jack.enable = true;
wireplumber.enable = true;
};
hardware.bluetooth.enable = true; hardware.bluetooth.enable = true;
@ -43,5 +54,7 @@
stilo-themes stilo-themes
firefox firefox
glxinfo
start-plasma-shortcut
]; ];
} }

View File

@ -0,0 +1,7 @@
{...}: {
boot.loader = {
systemd-boot.enable = true;
efi.canTouchEfiVariables = true;
efi.efiSysMountPoint = "/boot";
};
}

View File

@ -0,0 +1,19 @@
# Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page, on
# https://search.nixos.org/options and in the NixOS manual (`nixos-help`).
{ asahi-firmware, ... }:
{
# Use the systemd-boot EFI boot loader.
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = false;
hardware.asahi.peripheralFirmwareDirectory = asahi-firmware;
hardware.asahi.enable = true;
hardware.asahi.setupAsahiSound = true;
hardware.asahi.useExperimentalGPUDriver = true;
hardware.asahi.experimentalGPUInstallMode = "replace";
}

View File

@ -0,0 +1,37 @@
# Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }:
{
imports =
[ (modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = [ "usb_storage" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ ];
boot.extraModulePackages = [ ];
fileSystems."/" =
{ device = "/dev/disk/by-uuid/f726ed7c-7f12-430c-b38b-e5533099fabe";
fsType = "ext4";
};
fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/8569-17E8";
fsType = "vfat";
options = [ "fmask=0022" "dmask=0022" ];
};
swapDevices = [ ];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
# (the default) this is the recommended approach. When using systemd-networkd it's
# still possible to use this option, but it's recommended to use it in conjunction
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
networking.useDHCP = lib.mkDefault true;
# networking.interfaces.wlan0.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "aarch64-linux";
}

View File

@ -1,21 +1,13 @@
{ {
pkgs, pkgs,
eth-interface ? "eth0", use-iwd ? false,
static-ip ? false, # false, or IPv4 address as string
default-gateway ? "192.168.1.1",
}: }:
let static-ip-conf = if static-ip != false then {
networking.defaultGateway = { address = default-gateway; interface = eth-interface; };
networking.useDHCP = false;
networking.interfaces.${eth-interface}.ipv4.addresses = [ {
address = static-ip;
prefixLength = 24;
} ];
networking.networkmanager.unmanaged = [eth-interface];
} else {};
in pkgs.lib.attrsets.recursiveUpdate static-ip-conf
{ {
networking.networkmanager.enable = true; networking.networkmanager = {
enable = true;
dhcp = "dhcpcd";
wifi.backend = if use-iwd then "iwd" else "wpa_supplicant";
};
networking.nameservers = [ "8.8.8.8" ]; networking.nameservers = [ "8.8.8.8" ];
networking.resolvconf.enable = true; networking.resolvconf.enable = true;
networking.resolvconf.dnsExtensionMechanism = false; # edns seems to be fucky with this enabled networking.resolvconf.dnsExtensionMechanism = false; # edns seems to be fucky with this enabled

18
nixos/tiny-dfr.nix Normal file
View File

@ -0,0 +1,18 @@
{
pkgs,
tiny-dfr ? pkgs.tiny-dfr
}: {
services.udev.packages = [ tiny-dfr ];
systemd.services.tiny-dfr = {
enable = true;
description = "tinydfr";
after = ["systemd-user-sessions.service" "getty@tty1.service" "plymouth-quit.service" "systemd-logind.service"];
wantedBy = ["multi-user.target"];
startLimitIntervalSec = 30;
startLimitBurst = 2;
serviceConfig = {
ExecStart = "${tiny-dfr}/bin/tiny-dfr";
Restart = "always";
};
};
}