Compare commits

..

3 Commits

Author SHA1 Message Date
e2049d9ad1 Asahi configuration 2024-06-27 11:24:25 +02:00
2088329723 Enable opengl 2024-06-27 11:24:08 +02:00
33da03e538 Switch to pipewire 2024-06-27 11:23:57 +02:00
6 changed files with 212 additions and 5 deletions

View File

@ -21,6 +21,21 @@
"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": {
"inputs": {
"systems": "systems"
@ -155,6 +170,28 @@
"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": {
"locked": {
"lastModified": 1717144377,
@ -177,11 +214,28 @@
"home-manager": "home-manager",
"kak": "kak",
"nix-darwin": "nix-darwin",
"nixos-apple-silicon": "nixos-apple-silicon",
"nixpkgs": "nixpkgs",
"unambig-path": "unambig-path",
"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": {
"locked": {
"lastModified": 1681028828,

View File

@ -29,9 +29,13 @@
url = "git+https://git@githug.xyz/xenia/unambig-path";
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
mkPkgs = system: import nixpkgs { system = system; config.allowUnfree = true; };
mkHome = {username, home-dir, prompt-color, system, pkgs} : import ./home/common.nix {
@ -146,5 +150,72 @@
{ 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";
};
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

@ -22,14 +22,21 @@
};
};
hardware.opengl.enable = true;
services.desktopManager.plasma6.enable = true;
services.displayManager.defaultSession = "plasma";
console.useXkbConfig = true;
# Enable sound.
sound.enable = true;
hardware.pulseaudio.enable = true;
sound.enable = false; # let pipewire handle sound
services.pipewire = {
enable = true;
alsa.enable = true;
pulse.enable = true;
jack.enable = true;
wireplumber.enable = true;
};
hardware.bluetooth.enable = true;
@ -43,5 +50,6 @@
stilo-themes
firefox
glxinfo
];
}

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";
}

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";
};
};
}