spotlights-macbook-air: Init Linux configuration

This commit is contained in:
Spotlight 2024-11-03 02:07:38 -06:00
parent 4aac7da0e8
commit 041bc7d3c0
Signed by: spotlight
GPG key ID: 874AA355B3209BDC
5 changed files with 228 additions and 9 deletions

3
.gitignore vendored
View file

@ -1,2 +1,5 @@
vim/.netrwhist vim/.netrwhist
keysrc keysrc
# macOS-provided firmware
hosts/linux/spotlights-macbook-air/firmware

72
flake.lock generated
View file

@ -15,6 +15,28 @@
"type": "github" "type": "github"
} }
}, },
"apple-silicon-support": {
"inputs": {
"flake-compat": "flake-compat",
"nixpkgs": [
"nixpkgs"
],
"rust-overlay": "rust-overlay"
},
"locked": {
"lastModified": 1729779640,
"narHash": "sha256-M9t4Ta9d76aVqd1mkLBl8zFSWYc8pv6AZTy1SU5bVp0=",
"owner": "zzywysm",
"repo": "nixos-asahi",
"rev": "5f8823f3543cbf9566d5af49b3a3c18539681eac",
"type": "github"
},
"original": {
"owner": "zzywysm",
"repo": "nixos-asahi",
"type": "github"
}
},
"darwin-systems": { "darwin-systems": {
"locked": { "locked": {
"lastModified": 1689347925, "lastModified": 1689347925,
@ -30,6 +52,21 @@
"type": "github" "type": "github"
} }
}, },
"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"
@ -55,11 +92,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1729716953, "lastModified": 1730490306,
"narHash": "sha256-FbRKGRRd0amsk/WS/UV9ukJ8jT1dZ2pJBISxkX+uq6A=", "narHash": "sha256-AvCVDswOUM9D368HxYD25RsSKp+5o0L0/JHADjLoD38=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "a4353cc43d1b4dd6bdeacea90eb92a8b7b78a9d7", "rev": "1743615b61c7285976f85b303a36cdf88a556503",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -90,11 +127,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1729826725, "lastModified": 1730600078,
"narHash": "sha256-w3WNlYxqWYsuzm/jgFPyhncduoDNjot28aC8j39TW0U=", "narHash": "sha256-BoyFmE59HDF3uybBySsWVoyjNuHvz3Wv8row/mSb958=",
"owner": "LnL7", "owner": "LnL7",
"repo": "nix-darwin", "repo": "nix-darwin",
"rev": "7840909b00fbd5a183008a6eb251ea307fe4a76e", "rev": "4652874d014b82cb746173ffc64f6a70044daa7e",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -105,11 +142,11 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1729665710, "lastModified": 1730200266,
"narHash": "sha256-AlcmCXJZPIlO5dmFzV3V2XF6x/OpNWUV8Y/FMPGd8Z4=", "narHash": "sha256-l253w0XMT8nWHGXuXqyiIC/bMvh1VRszGXgdpQlfhvU=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "2768c7d042a37de65bb1b5b3268fc987e534c49d", "rev": "807e9154dcb16384b1b765ebe9cd2bba2ac287fd",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -122,6 +159,7 @@
"root": { "root": {
"inputs": { "inputs": {
"all-systems": "all-systems", "all-systems": "all-systems",
"apple-silicon-support": "apple-silicon-support",
"darwin-systems": "darwin-systems", "darwin-systems": "darwin-systems",
"home-manager": "home-manager", "home-manager": "home-manager",
"linux-systems": "linux-systems", "linux-systems": "linux-systems",
@ -130,6 +168,22 @@
"vscode-server": "vscode-server" "vscode-server": "vscode-server"
} }
}, },
"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

@ -4,6 +4,10 @@
inputs = { inputs = {
# Specify the source of Home Manager and Nixpkgs. # Specify the source of Home Manager and Nixpkgs.
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
apple-silicon-support = {
url = "github:zzywysm/nixos-asahi";
inputs.nixpkgs.follows = "nixpkgs";
};
# Allows for easy enumeration of available Darwin and Linux systems. # Allows for easy enumeration of available Darwin and Linux systems.
all-systems.url = "github:nix-systems/default"; all-systems.url = "github:nix-systems/default";
darwin-systems.url = "github:nix-systems/default-darwin"; darwin-systems.url = "github:nix-systems/default-darwin";
@ -130,6 +134,29 @@
]; ];
}; };
nixosConfigurations = {
"spotlights-macbook-air" = nixpkgs.lib.nixosSystem {
system = "aarch64-linux";
modules = [
# Asahi-specific tweaks
inputs.apple-silicon-support.nixosModules.default
./hosts/linux/spotlights-macbook-air/configuration.nix
home-manager.nixosModules.home-manager
{
nixpkgs.overlays = [ self.overlays.default ];
home-manager = {
useGlobalPkgs = true;
useUserPackages = true;
users.spotlight = import ./home/home.nix;
extraSpecialArgs = { desktop = true; gpg = true; };
};
}
];
};
};
# We define a default Darwin configuration via nix-darwin. # We define a default Darwin configuration via nix-darwin.
darwinConfigurations."spotlights-macbook-air" = nix-darwin.lib.darwinSystem { darwinConfigurations."spotlights-macbook-air" = nix-darwin.lib.darwinSystem {
modules = [ modules = [

View file

@ -0,0 +1,97 @@
# 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`).
{ config, lib, pkgs, ... }:
{
imports = [
./hardware-configuration.nix
];
nix.settings.experimental-features = [ "flakes" "nix-command" ];
# Use the systemd-boot EFI boot loader.
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = false;
# GPU enablement
hardware.asahi = {
peripheralFirmwareDirectory = ./firmware;
# GPU enablement
useExperimentalGPUDriver = true;
experimentalGPUInstallMode = "replace";
withRust = true;
};
networking = {
hostName = "spotlights-macbook-air";
wireless.iwd = {
enable = true;
settings.General.EnableNetworkConfiguration = true;
};
networkmanager.enable = true;
};
services = {
# Enable GNOME
xserver = {
enable = true;
displayManager.gdm.enable = true;
desktopManager.gnome.enable = true;
};
avahi = {
enable = true;
# Enable .local resolution
nssmdns4 = true;
};
# Enable CUPS to print documents.
printing.enable = true;
};
# Our user account.
programs.zsh.enable = true;
users.users.spotlight = {
isNormalUser = true;
extraGroups = [ "wheel" ]; # Enable sudo for the user.
shell = pkgs.zsh;
};
environment.systemPackages = with pkgs; [
cachix
firefox
git
htop
gnomeExtensions.appindicator
legcord
minicom
nix-output-monitor
python3
seafile-client
telegram-desktop
tmux
usbutils
vim
vscode
wget
];
# :(
nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [
"vscode"
];
# Allow location services.
location.provider = "geoclue2";
services.geoclue2.enable = true;
# Some programs need SUID wrappers, can be configured further or are
# started in user sessions.
programs.gnupg.agent = {
enable = true;
pinentryPackage = pkgs.pinentry-gnome3;
};
system.stateVersion = "24.05";
}

View file

@ -0,0 +1,38 @@
{ 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/f6ce0d1f-a66d-4481-b338-611dc326efb6";
fsType = "ext4";
};
fileSystems."/boot" =
{
device = "/dev/disk/by-uuid/395D-1117";
fsType = "vfat";
options = [ "fmask=0022" "dmask=0022" ];
};
swapDevices =
[{ device = "/dev/disk/by-uuid/8def60e1-8298-4f5d-ac1f-52ed948aa3c1"; }];
# 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";
}