Nix-on-droid fixes

This commit is contained in:
Tyler Beckman 2024-12-21 22:29:34 -07:00
parent c6a0a4f631
commit 44a4ac95a9
Signed by: Ty
GPG key ID: 2813440C772555A4
7 changed files with 108 additions and 47 deletions

View file

@ -102,10 +102,7 @@
}; };
# Setup nix-on-droid configurations # Setup nix-on-droid configurations
nixOnDroidConfigurations.default = nix-on-droid.lib.nixOnDroidConfiguration { nixOnDroidConfigurations.default = utils.createDroidSystem { entrypoint = ./nix-on-droid/ty-pixel; };
pkgs = import nixpkgs { system = "aarch64-linux"; };
modules = [ ./nix-on-droid/ty-pixel ];
};
# Enable direct flake support for colmena # Enable direct flake support for colmena
colmenaHive = colmena.lib.makeHive self.outputs.colmena; colmenaHive = colmena.lib.makeHive self.outputs.colmena;

View file

@ -1,26 +1,10 @@
{ inputs, system, secrets, lib, config, ... }: { inputs, system, secrets, config, lib, ... }:
{ {
imports = [ ./meta.nix ]; imports = [ ./meta.nix ];
config = { config = {
# Allow user installation of packages home-manager = let
home-manager.useGlobalPkgs = true; entrypoint = {
home-manager.useUserPackages = true;
home-manager.sharedModules = [
# Import plasma manager and all of my custom modules for use
inputs.plasma-manager.homeManagerModules.plasma-manager
inputs.flatpaks.homeManagerModules.declarative-flatpak
./modules
];
# Inherit all of my nixos config custom arguments
home-manager.extraSpecialArgs = {
inherit inputs system secrets;
};
# Hopefully avoid file conflicts
home-manager.backupFileExtension = "backup";
home-manager.users.ty = {
imports = [ imports = [
# Import meta options for configuring the configuration # Import meta options for configuring the configuration
./meta.nix ./meta.nix
@ -33,5 +17,35 @@
# Inherit my home manager config options # Inherit my home manager config options
meta.home-manager = config.meta.home-manager; meta.home-manager = config.meta.home-manager;
}; };
in lib.mkMerge [
## General home-manager.* options
{
# Allow user installation of packages
useGlobalPkgs = true;
useUserPackages = true;
sharedModules = [
# Import plasma manager and all of my custom modules for use
inputs.plasma-manager.homeManagerModules.plasma-manager
inputs.flatpaks.homeManagerModules.declarative-flatpak
./modules
];
# Inherit all of my nixos config custom arguments
extraSpecialArgs = {
inherit inputs system secrets;
};
# Hopefully avoid file conflicts
backupFileExtension = "bak";
}
# The nixos home-manager module and the nix-on-droid compatibility have different options,
# so this handles both in the same file
(if (config.meta.home-manager.interface == "nixos") then {
users.ty = entrypoint;
} else {
config = entrypoint;
})
];
}; };
} }

View file

@ -30,6 +30,13 @@
firefox.enable = lib.mkEnableOption "firefox configuration"; firefox.enable = lib.mkEnableOption "firefox configuration";
rescrobbled.enable = lib.mkEnableOption "rescrobbled configuration"; rescrobbled.enable = lib.mkEnableOption "rescrobbled configuration";
vscode.enable = lib.mkEnableOption "vscode configuration"; vscode.enable = lib.mkEnableOption "vscode configuration";
interface = lib.mkOption {
type = lib.types.enum [ "nixos" "nix-on-droid" ];
default = "nixos";
defaultText = lib.literalExpression ''"nixos"'';
description = "The interface to use for configuring home-manger as a module";
};
}; };
# Handle preset logic # Handle preset logic

View file

@ -2,6 +2,8 @@
{ {
networking.hostName = "ty-nixos"; networking.hostName = "ty-nixos";
# networking.hosts = { "23.95.137.176" = [ "s.optifine.net" ]; };
# Enable firewall # Enable firewall
networking.firewall.enable = true; networking.firewall.enable = true;

View file

@ -1,15 +1,25 @@
{ ... }: { { inputs, system, secrets, pkgs, ... }: {
system.stateVersion = "24.05"; imports = [
./environment.nix
home-manager.config = { # Import full home-manager config
imports = [ ../../home-manager ]; ../../home-manager
];
meta.home-manager.preset = "cli"; meta.home-manager = { preset = "cli"; interface = "nix-on-droid"; };
};
environment.etcBackupExtension = ".bak"; nix = {
extraOptions = ''
nix.extraOptions = ''
experimental-features = nix-command flakes experimental-features = nix-command flakes
''; '';
nixPath = [ "nixpkgs=${inputs.nixpkgs}" ];
};
user.shell = "${pkgs.zsh}/bin/zsh";
time.timeZone = "America/Denver";
terminal = {
font = "${pkgs.nerd-fonts.fira-code}/share/fonts/truetype/NerdFonts/FiraCode/FiraCodeNerdFont-Regular.ttf";
};
system.stateVersion = "24.05";
} }

View file

@ -0,0 +1,20 @@
{ pkgs, ... }:
{
environment = {
etcBackupExtension = ".bak";
packages = with pkgs; [
# Basic necessities
wget
curl
neovim
# Nix tools
nvd
# VCS
git
jujutsu
];
motd = "";
};
}

View file

@ -77,4 +77,15 @@
{} {}
hostConfigs hostConfigs
); );
createDroidSystem = {
system ? "aarch64-linux",
entrypoint
}: inputs.nix-on-droid.lib.nixOnDroidConfiguration {
pkgs = import inputs.nixpkgs { inherit system; };
modules = [ entrypoint ];
extraSpecialArgs = {
inherit inputs system secrets;
};
};
} }