nix/flake.nix

819 lines
24 KiB
Nix
Raw Normal View History

2023-09-04 11:40:30 -05:00
{
inputs = {
2024-06-01 20:08:59 -05:00
nixpkgs.url = "github:nixos/nixpkgs/nixos-24.05";
2024-06-29 01:40:25 -05:00
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixpkgs-unstable";
2024-02-29 09:02:36 -06:00
2024-06-17 13:00:23 -05:00
disko.url = "github:nix-community/disko/master";
disko.inputs.nixpkgs.follows = "nixpkgs";
sops-nix.url = "github:Mic92/sops-nix";
2024-06-29 01:40:25 -05:00
sops-nix.inputs.nixpkgs.follows = "nixpkgs-unstable";
2024-11-24 16:44:17 -06:00
# sops-nix.inputs.nixpkgs-stable.follows = "nixpkgs";
2024-07-24 13:20:06 -05:00
git-hooks.url = "github:cachix/git-hooks.nix";
git-hooks.inputs.nixpkgs.follows = "nixpkgs";
2024-06-17 13:00:23 -05:00
home-manager.url = "github:nix-community/home-manager/release-24.05";
2023-11-07 17:09:05 -06:00
home-manager.inputs.nixpkgs.follows = "nixpkgs";
2024-07-29 11:29:05 -05:00
home-manager-unstable.url = "github:nix-community/home-manager";
home-manager-unstable.inputs.nixpkgs.follows = "nixpkgs-unstable";
2023-12-04 09:14:13 -06:00
helix.url = "github:helix-editor/helix/master";
2023-10-03 17:09:12 -05:00
hardware.url = "github:nixos/nixos-hardware";
2024-03-22 09:54:00 -05:00
hyprland.url = "github:hyprwm/Hyprland";
2024-07-30 16:36:41 -05:00
2024-08-30 11:24:53 -05:00
wezterm.url = "github:wez/wezterm?dir=nix";
wezterm.inputs.nixpkgs.follows = "nixpkgs-unstable";
2024-07-30 17:07:50 -05:00
slippi.url = "github:lytedev/slippi-nix";
# slippi.url = "git+file:///home/daniel/code/open-source/slippi-nix";
2024-07-30 15:16:46 -05:00
slippi.inputs.nixpkgs.follows = "nixpkgs-unstable";
slippi.inputs.home-manager.follows = "home-manager-unstable";
2024-07-17 14:18:35 -05:00
2024-10-15 10:10:28 -05:00
jovian.url = "github:Jovian-Experiments/Jovian-NixOS/development";
jovian.inputs.nixpkgs.follows = "nixpkgs-unstable";
2024-07-17 15:08:24 -05:00
# nnf.url = "github:thelegy/nixos-nftables-firewall?rev=71fc2b79358d0dbacde83c806a0f008ece567b7b";
2024-10-08 19:42:33 -05:00
mobile-nixos = {
url = "github:lytedev/mobile-nixos";
flake = false;
};
2023-09-04 11:40:30 -05:00
};
nixConfig = {
extra-experimental-features = ["nix-command" "flakes"];
extra-substituters = [
"https://cache.nixos.org/"
"https://helix.cachix.org"
"https://nix-community.cachix.org"
2024-09-11 13:39:57 -05:00
"https://nix.h.lyte.dev"
"https://hyprland.cachix.org"
];
extra-trusted-public-keys = [
"cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY="
"helix.cachix.org-1:ejp9KQpR1FBI2onstMQ34yogDm4OgU2ru6lIwPvuCVs="
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
"h.lyte.dev-2:te9xK/GcWPA/5aXav8+e5RHImKYMug8hIIbhHsKPN0M="
"hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc="
];
};
2023-10-03 11:52:44 -05:00
outputs = {
self,
2023-10-18 09:14:19 -05:00
nixpkgs,
2024-06-29 01:40:25 -05:00
nixpkgs-unstable,
2024-06-28 09:51:25 -05:00
disko,
2024-06-28 14:01:32 -05:00
sops-nix,
2024-07-24 13:20:06 -05:00
git-hooks,
2024-08-30 11:24:53 -05:00
wezterm,
2023-10-03 11:52:44 -05:00
home-manager,
2024-07-29 11:29:05 -05:00
home-manager-unstable,
2024-06-28 09:51:25 -05:00
helix,
2024-02-28 09:31:58 -06:00
hardware,
2024-10-15 10:10:28 -05:00
jovian,
2024-10-08 19:42:33 -05:00
mobile-nixos,
2024-07-17 15:08:24 -05:00
# nnf,
2024-06-28 11:50:18 -05:00
# hyprland,
2024-06-28 09:51:25 -05:00
slippi,
2023-10-03 11:52:44 -05:00
...
2024-06-28 09:51:25 -05:00
}: let
inherit (self) outputs;
2024-06-28 14:01:32 -05:00
inherit (outputs) nixosModules homeManagerModules overlays;
2024-06-28 09:51:25 -05:00
# TODO: make @ inputs unnecessary by making arguments explicit in all modules?
2024-06-25 09:38:00 -05:00
systems = ["aarch64-linux" "aarch64-darwin" "x86_64-darwin" "x86_64-linux"];
forSystems = nixpkgs.lib.genAttrs systems;
2024-06-28 14:01:32 -05:00
pkgsFor = system: (import nixpkgs {inherit system;}).extend overlays.default;
2024-06-28 09:51:25 -05:00
genPkgs = func: (forSystems (system: func (pkgsFor system)));
pkg = callee: overrides: genPkgs (pkgs: pkgs.callPackage callee overrides);
2024-07-28 08:31:45 -05:00
unstable = {
forSystems = nixpkgs-unstable.lib.genAttrs systems;
pkgsFor = system: (import nixpkgs-unstable {inherit system;}).extend overlays.default;
genPkgs = func: (forSystems (system: func (pkgsFor system)));
pkg = callee: overrides: genPkgs (pkgs: pkgs.callPackage callee overrides);
};
2024-09-12 11:22:43 -05:00
style = {
colors = (import ./lib/colors.nix {inherit (nixpkgs) lib;}).schemes.catppuccin-mocha-sapphire;
2024-06-28 09:51:25 -05:00
2024-09-12 11:22:43 -05:00
font = {
name = "IosevkaLyteTerm";
size = 12;
};
};
2024-01-04 14:45:10 -06:00
2024-09-12 12:05:22 -05:00
/*
moduleArgs = {
# inherit style;
inherit helix slippi hyprland hardware disko home-manager;
inherit (outputs) nixosModules homeManagerModules diskoConfigurations overlays;
};
*/
2024-06-28 11:50:18 -05:00
pubkey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAPLXOjupz3ScYjgrF+ehrbp9OvGAWQLI6fplX6w9Ijb daniel@lyte.dev";
2024-06-28 09:51:25 -05:00
in {
2024-09-12 12:05:22 -05:00
/*
kind of a quirk, but package definitions are actually in the "additions"
overlay I did this to work around some recursion problems
TODO: https://discourse.nixos.org/t/infinite-recursion-getting-started-with-overlays/48880
*/
2024-07-24 12:14:01 -05:00
packages = genPkgs (pkgs: {inherit (pkgs) iosevkaLyteTerm iosevkaLyteTermSubset nix-base-container-image;});
2024-09-04 10:31:06 -05:00
diskoConfigurations = import ./disko {inherit (nixpkgs) lib;};
2024-06-28 09:51:25 -05:00
templates = import ./templates;
formatter = genPkgs (p: p.alejandra);
2023-10-06 01:30:15 -05:00
2024-07-24 13:20:06 -05:00
checks = genPkgs ({system, ...}: {
git-hooks = git-hooks.lib.${system}.run {
src = ./.;
hooks = {
alejandra.enable = true;
};
};
2024-07-24 13:20:06 -05:00
});
2024-07-24 13:20:06 -05:00
devShells = genPkgs ({
2024-06-28 09:51:25 -05:00
system,
pkgs,
mkShell,
2024-07-24 13:20:06 -05:00
...
2024-06-28 09:51:25 -05:00
}: {
default = mkShell {
2024-07-24 13:20:06 -05:00
inherit (outputs.checks.${system}.git-hooks) shellHook;
2024-07-30 15:16:46 -05:00
packages = with pkgs; [
2024-03-25 09:44:55 -05:00
lua-language-server
2024-06-28 09:51:25 -05:00
nodePackages.bash-language-server
2024-03-25 09:44:55 -05:00
];
2024-06-28 09:51:25 -05:00
};
2024-07-24 13:20:06 -05:00
});
2024-06-28 09:51:25 -05:00
overlays = {
2024-06-28 11:50:18 -05:00
# the default overlay composes all the other overlays together
default = final: prev: {
2024-06-28 14:01:32 -05:00
overlays = with overlays; [
2024-06-28 11:50:18 -05:00
additions
modifications
2024-06-29 01:40:25 -05:00
unstable-packages
2024-06-28 11:50:18 -05:00
];
};
2024-06-28 14:01:32 -05:00
additions = final: prev: let
iosevkaLyteTerm = prev.callPackage ./packages/iosevkaLyteTerm.nix {};
in {
inherit iosevkaLyteTerm;
iosevkaLyteTermSubset = prev.callPackage ./packages/iosevkaLyteTermSubset.nix {
inherit iosevkaLyteTerm;
};
2024-07-24 12:14:01 -05:00
nix-base-container-image = final.dockerTools.buildImageWithNixDb {
name = "git.lyte.dev/lytedev/nix";
tag = "latest";
copyToRoot = with final; [
bash
coreutils
curl
gawk
gitFull
git-lfs
gnused
nodejs
wget
sudo
nixFlakes
cacert
gnutar
gzip
openssh
xz
(pkgs.writeTextFile {
name = "nix.conf";
destination = "/etc/nix/nix.conf";
text = ''
accept-flake-config = true
experimental-features = nix-command flakes
2024-07-24 13:31:28 -05:00
build-users-group =
2024-07-24 12:34:31 -05:00
substituters = https://nix.h.lyte.dev https://cache.nixos.org/
trusted-substituters = https://nix.h.lyte.dev https://cache.nixos.org/
trusted-public-keys = h.lyte.dev:HeVWtne31ZG8iMf+c15VY3/Mky/4ufXlfTpT8+4Xbs0= cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=
2024-07-24 12:14:01 -05:00
'';
})
];
extraCommands = ''
# enable /usr/bin/env for scripts
2024-07-24 12:34:31 -05:00
mkdir -p usr
ln -s ../bin usr/bin
# create /tmp
mkdir -p tmp
2024-07-24 12:14:01 -05:00
# create HOME
2024-07-24 12:34:31 -05:00
mkdir -vp root
2024-07-24 12:14:01 -05:00
'';
config = {
Cmd = ["/bin/bash"];
Env = [
"LANG=en_GB.UTF-8"
"ENV=/etc/profile.d/nix.sh"
"BASH_ENV=/etc/profile.d/nix.sh"
"NIX_BUILD_SHELL=/bin/bash"
"PAGER=cat"
"PATH=/usr/bin:/bin"
"SSL_CERT_FILE=${final.cacert}/etc/ssl/certs/ca-bundle.crt"
"USER=root"
];
};
};
2024-06-28 14:01:32 -05:00
};
2023-10-03 11:52:44 -05:00
2024-08-30 11:24:53 -05:00
modifications = final: prev: let
wezterm-input = wezterm;
in rec {
2024-07-31 21:13:37 -05:00
helix = helix.outputs.packages.${prev.system}.helix;
final.helix = helix;
2024-09-12 12:05:22 -05:00
/*
TODO: would love to use a current wezterm build so I can make use of ssh/mux functionality without breakage
source: https://github.com/wez/wezterm/issues/3771
not-yet-merged (abandoned?): https://github.com/wez/wezterm/pull/4737
I did try using the latest code via the flake, but alas it did not resolve my issues with mux'ing
*/
2024-08-30 11:24:53 -05:00
wezterm = wezterm-input.outputs.packages.${prev.system}.default;
2024-11-22 08:13:16 -06:00
# wezterm = (import nixpkgs {inherit (prev) system;}).wezterm;
2024-08-30 11:04:17 -05:00
final.wezterm = wezterm;
2024-11-05 09:04:54 -06:00
zellij = prev.zellij.overrideAttrs rec {
version = "0.41.0";
src = prev.fetchFromGitHub {
owner = "zellij-org";
repo = "zellij";
rev = "v0.41.0";
hash = "sha256-A+JVWYz0t9cVA8XZciOwDkCecsC2r5TU2O9i9rVg7do=";
};
cargoDeps = prev.zellij.cargoDeps.overrideAttrs (prev.lib.const {
name = "zellij-vendor.tar.gz";
inherit src;
outputHash = "sha256-WxrMI7fV0pNsGjbNpXLr+xnMdWYkC4WxIeN4OK3ZPIE=";
});
};
final.zellij = zellij;
};
2023-10-03 11:52:44 -05:00
2024-06-29 01:40:25 -05:00
unstable-packages = final: _prev: {
unstable-packages = import nixpkgs-unstable {
system = final.system;
config.allowUnfree = true;
};
};
2024-06-28 11:50:18 -05:00
};
nixosModules = import ./modules/nixos {
2024-09-12 11:22:43 -05:00
inherit home-manager home-manager-unstable helix nixosModules homeManagerModules pubkey overlays style sops-nix disko;
flakeInputs = self.inputs;
2024-06-28 11:50:18 -05:00
};
homeManagerModules = import ./modules/home-manager {
2024-09-12 11:22:43 -05:00
inherit home-manager home-manager-unstable helix nixosModules homeManagerModules pubkey overlays style;
2024-06-28 21:36:19 -05:00
inherit (nixpkgs) lib;
flakeInputs = self.inputs;
2024-06-28 14:01:32 -05:00
};
nixosConfigurations = {
2024-11-03 11:08:49 -06:00
beefcake = let
2024-06-28 14:01:32 -05:00
system = "x86_64-linux";
2024-11-03 11:08:49 -06:00
in
nixpkgs.lib.nixosSystem {
inherit system;
modules = with nixosModules; [
home-manager-defaults
# TODO: disko?
hardware.nixosModules.common-cpu-intel
outputs.nixosModules.deno-netlify-ddns-client
{
services.deno-netlify-ddns-client = {
enable = true;
username = "beefcake.h";
# TODO: router doesn't even do ipv6 yet...
ipv6 = false;
};
}
family-users
common
podman
troubleshooting-tools
virtual-machines
virtual-machines-gui
linux
fonts
./nixos/beefcake.nix
{
services.kanidm.package = (unstable.pkgsFor system).kanidm;
}
];
};
2024-06-28 14:01:32 -05:00
2024-07-29 11:29:05 -05:00
dragon = nixpkgs-unstable.lib.nixosSystem {
2024-06-28 14:01:32 -05:00
system = "x86_64-linux";
modules = with nixosModules; [
2024-07-29 11:29:05 -05:00
home-manager-unstable-defaults
2024-06-28 22:04:37 -05:00
outputs.diskoConfigurations.standard
hardware.nixosModules.common-cpu-amd
hardware.nixosModules.common-pc-ssd
2024-06-28 14:01:32 -05:00
2024-07-11 12:51:51 -05:00
common
2024-07-10 09:57:10 -05:00
password-manager
wifi
graphical-workstation
2024-10-03 09:23:44 -05:00
virtual-machines
virtual-machines-gui
music-production
gaming
slippi.nixosModules.default
2024-06-28 14:01:32 -05:00
2024-09-14 07:43:11 -05:00
outputs.nixosModules.deno-netlify-ddns-client
{
services.deno-netlify-ddns-client = {
enable = true;
username = "dragon.h";
# TODO: router doesn't even do ipv6 yet...
ipv6 = false;
};
}
./nixos/dragon.nix
2024-06-28 14:01:32 -05:00
{
2024-06-28 14:01:32 -05:00
home-manager.users.daniel = {
imports = with homeManagerModules; [
senpai
iex
cargo
firefox-no-tabs
linux-desktop-environment-config
slippi.homeManagerModules.default
];
};
2024-06-28 14:44:46 -05:00
}
2024-06-28 14:01:32 -05:00
];
};
2024-06-28 11:50:18 -05:00
2024-08-06 10:41:57 -05:00
bigtower = nixpkgs-unstable.lib.nixosSystem {
system = "x86_64-linux";
modules = with nixosModules; [
home-manager-unstable-defaults
outputs.diskoConfigurations.unencrypted
hardware.nixosModules.common-cpu-amd
hardware.nixosModules.common-pc-ssd
common
# wifi
graphical-workstation
music-production
gaming
./nixos/bigtower.nix
{
home-manager.users.daniel = {
imports = with homeManagerModules; [
firefox-no-tabs
linux-desktop-environment-config
];
};
}
];
};
2024-06-29 00:51:22 -05:00
htpc = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = with nixosModules; [
2024-07-29 11:29:05 -05:00
home-manager-defaults
2024-06-29 00:51:22 -05:00
hardware.nixosModules.common-pc-ssd
2024-07-11 12:51:51 -05:00
common
2024-08-30 13:02:20 -05:00
gaming
2024-06-29 00:51:22 -05:00
graphical-workstation
2024-09-22 20:20:15 -05:00
plasma6
2024-06-29 00:51:22 -05:00
./nixos/htpc.nix
{
home-manager.users.daniel = {
imports = with homeManagerModules; [
linux-desktop-environment-config
];
};
}
];
};
2024-10-15 10:10:28 -05:00
steamdeck1 = nixpkgs-unstable.lib.nixosSystem {
system = "x86_64-linux";
modules = with nixosModules; [
home-manager-unstable-defaults
outputs.diskoConfigurations.standard
hardware.nixosModules.common-pc-ssd
common
gaming
graphical-workstation
plasma6
jovian.outputs.nixosModules.jovian
{
networking.hostName = "steamdeck1";
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
hardware.bluetooth.enable = true;
networking.networkmanager.enable = true;
home-manager.users.daniel = {
imports = with homeManagerModules; [
firefox-no-tabs
linux-desktop-environment-config
];
};
}
];
};
2024-07-28 08:31:45 -05:00
foxtrot = nixpkgs-unstable.lib.nixosSystem {
2024-06-28 14:44:46 -05:00
system = "x86_64-linux";
modules = with nixosModules; [
2024-07-29 11:29:05 -05:00
home-manager-unstable-defaults
2024-06-28 21:36:19 -05:00
outputs.diskoConfigurations.standard
hardware.nixosModules.framework-13-7040-amd
2024-07-11 12:51:51 -05:00
common
kde-connect
2024-07-11 21:25:18 -05:00
password-manager
2024-06-28 21:36:19 -05:00
graphical-workstation
2024-10-03 09:23:44 -05:00
virtual-machines
virtual-machines-gui
2024-06-28 21:36:19 -05:00
laptop
gaming
2024-10-10 11:46:03 -05:00
cross-compiler
2024-06-28 21:36:19 -05:00
2024-06-28 14:44:46 -05:00
./nixos/foxtrot.nix
2024-06-28 21:36:19 -05:00
({pkgs, ...}: {
2024-06-28 21:36:19 -05:00
home-manager.users.daniel = {
imports = with homeManagerModules; [
senpai
iex
cargo
firefox-no-tabs
linux-desktop-environment-config
];
};
2024-07-14 22:29:42 -05:00
environment.systemPackages = with pkgs; [
fw-ectool
(writeShellApplication
{
name = "reset-wifi-module";
runtimeInputs = with pkgs; [kmod];
text = ''
modprobe -rv mt7921e
modprobe -v mt7921e
'';
})
(writeShellApplication
{
name = "perfmode";
# we use command -v $cmd here because we only want to invoke these calls _if_ the related package is installed on the system
# otherwise, they will likely have no effect anyways
text = ''
2024-11-22 08:13:16 -06:00
command -v powerprofilesctl &>/dev/null && bash -x -c 'powerprofilesctl set balanced'
2024-10-09 09:44:36 -05:00
command -v swaymsg &>/dev/null && bash -x -c 'swaymsg output eDP-1 mode 2880x1920@120Hz'
'';
})
(writeShellApplication
{
name = "battmode";
text = ''
2024-09-30 09:16:54 -05:00
command -v powerprofilesctl &>/dev/null && bash -x -c 'powerprofilesctl set power-saver'
2024-10-03 09:23:44 -05:00
command -v swaymsg &>/dev/null && bash -x -c 'swaymsg output eDP-1 mode 2880x1920@60Hz'
'';
})
];
})
2024-06-28 11:50:18 -05:00
];
};
2024-07-29 11:29:05 -05:00
thablet = nixpkgs-unstable.lib.nixosSystem {
2024-06-28 14:44:46 -05:00
system = "x86_64-linux";
modules = with nixosModules; [
2024-07-29 11:29:05 -05:00
home-manager-unstable-defaults
2024-06-28 21:36:19 -05:00
outputs.diskoConfigurations.standard
hardware.nixosModules.lenovo-thinkpad-x1-yoga
2024-06-29 02:55:19 -05:00
common
2024-07-13 10:32:19 -05:00
password-manager
2024-06-29 02:55:19 -05:00
graphical-workstation
2024-07-17 20:22:16 -05:00
music-production
2024-06-29 02:55:19 -05:00
laptop
gaming
./nixos/thablet.nix
{
home-manager.users.daniel = {
imports = with homeManagerModules; [
2024-07-18 07:55:24 -05:00
senpai
2024-06-29 02:55:19 -05:00
iex
cargo
2024-07-18 07:55:24 -05:00
firefox-no-tabs
2024-06-29 02:55:19 -05:00
linux-desktop-environment-config
2024-07-31 19:00:50 -05:00
# slippi.homeManagerModules.default
2024-06-29 02:55:19 -05:00
];
};
}
];
};
2024-09-12 12:05:22 -05:00
/*
grablet = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = with nixosModules; [
common
outputs.diskoConfigurations.standard
hardware.nixosModules.common-cpu-intel-kaby-lake
hardware.nixosModules.common-pc-laptopp-ssd
graphical-workstation
laptop
gaming
./nixos/thablet.nix
{
home-manager.users.daniel = {
imports = with homeManagerModules; [
iex
cargo
linux-desktop-environment-config
];
};
powerManagement.cpuFreqGovernor = lib.mkDefault "performance";
}
];
};
*/
2024-07-11 12:51:51 -05:00
2024-07-29 11:29:05 -05:00
thinker = nixpkgs-unstable.lib.nixosSystem {
2024-06-28 14:44:46 -05:00
system = "x86_64-linux";
modules = with nixosModules; [
2024-07-29 11:29:05 -05:00
home-manager-unstable-defaults
2024-07-17 20:49:12 -05:00
{
_module.args = {
disks = ["/dev/nvme0n1"];
swapSize = "32G";
};
}
2024-07-17 20:55:05 -05:00
outputs.diskoConfigurations.standardWithHibernateSwap
2024-07-17 22:08:32 -05:00
hardware.nixosModules.lenovo-thinkpad-t480
hardware.nixosModules.common-pc-laptop-ssd
2024-07-17 20:22:16 -05:00
music-production
2024-06-28 11:50:18 -05:00
common
2024-07-17 20:22:16 -05:00
password-manager
graphical-workstation
laptop
gaming
2024-06-28 14:44:46 -05:00
./nixos/thinker.nix
2024-07-17 20:22:16 -05:00
{
home-manager.users.daniel = {
imports = with homeManagerModules; [
2024-07-18 07:55:24 -05:00
senpai
2024-07-17 20:22:16 -05:00
iex
cargo
2024-07-18 07:55:24 -05:00
firefox-no-tabs
2024-07-17 20:22:16 -05:00
linux-desktop-environment-config
2024-07-18 07:55:24 -05:00
slippi.homeManagerModules.default
2024-07-17 20:22:16 -05:00
];
};
}
2024-06-28 11:50:18 -05:00
];
};
2024-07-19 12:15:39 -05:00
musicbox = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = with nixosModules; [
2024-07-29 11:29:05 -05:00
home-manager-defaults
2024-07-19 12:15:39 -05:00
{
_module.args = {
disks = ["/dev/sda"];
# swapSize = "8G";
};
}
outputs.diskoConfigurations.unencrypted
hardware.nixosModules.common-pc-laptop-ssd
music-production
common
graphical-workstation
wifi
# ./nixos/musicbox.nix
{
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
hardware.bluetooth.enable = true;
networking.networkmanager.enable = true;
home-manager.users.daniel = {
imports = with homeManagerModules; [
firefox-no-tabs
linux-desktop-environment-config
];
};
}
];
};
2024-06-28 09:51:25 -05:00
2024-06-28 14:44:46 -05:00
rascal = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = with nixosModules; [
2024-07-29 11:29:05 -05:00
home-manager-defaults
2024-06-28 15:50:00 -05:00
hardware.nixosModules.common-cpu-amd
2024-06-28 14:44:46 -05:00
common
2024-09-04 11:28:57 -05:00
linux
2024-06-28 14:44:46 -05:00
./nixos/rascal.nix
];
};
router = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = with nixosModules; [
2024-07-29 11:29:05 -05:00
home-manager-defaults
2024-07-13 14:41:30 -05:00
outputs.diskoConfigurations.unencrypted
common
2024-07-17 15:08:24 -05:00
linux
2024-07-18 10:01:56 -05:00
troubleshooting-tools
2024-09-13 00:38:04 -05:00
outputs.nixosModules.deno-netlify-ddns-client
{
services.deno-netlify-ddns-client = {
enable = true;
username = "router.h";
# TODO: ipv6
ipv6 = false;
};
}
2024-09-12 12:05:22 -05:00
/*
NOTE: maybe use this someday, but I think I need more concrete
networking knowledge before I know how to use it well. Additionally,
I can use my existing firewall configuration more easily if I manage
it directly.
nnf.nixosModules.default
*/
2024-07-18 10:01:56 -05:00
./nixos/router.nix
2024-06-28 14:44:46 -05:00
];
};
2024-10-08 19:42:33 -05:00
# pinephone-image =
# (import "${mobile-nixos}/lib/eval-with-configuration.nix" {
# configuration = with nixosModules; [
# linux
# home-manager-defaults
# # outputs.diskoConfigurations.unencrypted # can I even disko with an image-based installation?
# common
# wifi
# # TODO: how do I get a minimally useful mobile environment?
# # for me, this means an on-screen keyboard and suspend support I think?
# # I can live in a tty if needed and graphical stuff can all evolve later
# # not worried about modem
# # maybe/hopefully I can pull in or define my own sxmo via nix?
# ];
# device = "pine64-pinephone";
# pkgs = pkgsFor "aarch64-linux";
# })
# .outputs
# .disk-image;
2024-10-08 20:22:11 -05:00
pinephone = let
inherit (nixpkgs-unstable) lib;
in
2024-10-09 11:04:24 -05:00
lib.nixosSystem {
system = "aarch64-linux";
# lib.nixosSystem {
2024-10-08 20:22:11 -05:00
2024-10-09 11:04:24 -05:00
modules = with nixosModules; [
2024-10-08 20:22:11 -05:00
{
imports = [
2024-10-09 09:44:36 -05:00
(import "${mobile-nixos}/lib/configuration.nix" {
device = "pine64-pinephone";
})
2024-10-08 20:22:11 -05:00
];
2024-10-09 11:04:24 -05:00
# nixpkgs.hostPlatform.system = "aarch64-linux";
nixpkgs.buildPlatform = "x86_64-linux";
2024-10-08 20:22:11 -05:00
# TODO: quirk: since the pinephone kernel doesn't seem to have "rpfilter" support, firewall ain't working
networking.firewall.enable = lib.mkForce false;
# TODO: quirk: since git send-email requires perl support, which we don't seem to have on the pinephone, we're just disabling git for now
# TODO: would likely be easier/better to somehow ignore the assertion? probably a way to do that...
programs.git.enable = lib.mkForce false;
# this option is conflicted, presumably due to some assumption in my defaults/common config
# the sd-image module we're importing above has this set to true, so we better go with that?
# that said, I think the mobile-nixos bootloader module has this set to false, so...
# TODO: what does this mean?
boot.loader.generic-extlinux-compatible.enable = lib.mkForce true;
# another conflicting option since I think I default to NetworkManager and this conflicts with networking.wireless.enable
networking.networkmanager.enable = lib.mkForce false;
networking.wireless.enable = lib.mkForce true;
2024-10-08 20:22:11 -05:00
}
2024-10-09 11:04:24 -05:00
# TODO: how do I build this as a .img to flash to an SD card?
# for testing, this seems to work `nixos-rebuild build --impure --flake .#pinephone`
# TODO: would like to use the mobile-nixos installer?
"${nixpkgs-unstable}/nixos/modules/installer/sd-card/sd-image-aarch64-installer.nix"
linux
home-manager-unstable-defaults
# outputs.diskoConfigurations.unencrypted # can I even disko with an image-based installation?
common
wifi
{
system.stateVersion = "24.11";
}
{
# nixpkgs.buildPlatform = "x86_64-linux";
# nixpkgs.hostPlatform = lib.systems.examples.aarch64-multiplatform;
# nixpkgs.localSystem.system = lib.systems.examples.x86_64-linux;
# nixpkgs.crossSystem = lib.mkForce null;
}
2024-10-08 20:22:11 -05:00
];
};
2024-06-28 14:44:46 -05:00
};
2024-06-28 09:51:25 -05:00
2024-10-09 09:57:09 -05:00
images.pinephone = outputs.nixosConfigurations.pinephone.config.system.build.sdImage;
2024-08-23 09:33:50 -05:00
homeConfigurations = {
"deck" = let
system = "x86_64-linux";
2024-08-23 14:11:13 -05:00
pkgs = unstable.pkgsFor system;
2024-08-23 09:33:50 -05:00
in
2024-08-23 13:33:33 -05:00
home-manager-unstable.lib.homeManagerConfiguration {
2024-08-23 09:39:36 -05:00
inherit pkgs;
2024-08-23 09:33:50 -05:00
modules = with homeManagerModules; [
common
{
home = {
homeDirectory = "/home/deck";
username = "deck";
2024-08-23 13:34:47 -05:00
stateVersion = "24.11";
2024-08-23 09:33:50 -05:00
};
}
{
home.packages = with pkgs; [
ludusavi
rclone
];
}
linux
];
};
};
2024-01-04 14:45:10 -06:00
2024-09-12 12:05:22 -05:00
/*
2024-10-08 19:42:33 -05:00
TODO: nix-on-droid for phone terminal usage? mobile-nixos?
2024-09-12 12:05:22 -05:00
TODO: nix-darwin for work?
TODO: nixos ISO?
*/
2023-12-19 10:27:11 -06:00
};
2023-09-04 11:40:30 -05:00
}