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
nixOnDroidConfigurations.default = nix-on-droid.lib.nixOnDroidConfiguration {
pkgs = import nixpkgs { system = "aarch64-linux"; };
modules = [ ./nix-on-droid/ty-pixel ];
};
nixOnDroidConfigurations.default = utils.createDroidSystem { entrypoint = ./nix-on-droid/ty-pixel; };
# Enable direct flake support for colmena
colmenaHive = colmena.lib.makeHive self.outputs.colmena;

View file

@ -1,37 +1,51 @@
{ inputs, system, secrets, lib, config, ... }:
{ inputs, system, secrets, config, lib, ... }:
{
imports = [ ./meta.nix ];
config = {
# Allow user installation of packages
home-manager.useGlobalPkgs = true;
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
home-manager = let
entrypoint = {
imports = [
# Import meta options for configuring the configuration
./meta.nix
# Import all of my config
./config
];
home.stateVersion = "24.05";
# Inherit my home manager config options
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;
})
];
# 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 = [
# Import meta options for configuring the configuration
./meta.nix
# Import all of my config
./config
];
home.stateVersion = "24.05";
# Inherit my home manager config options
meta.home-manager = config.meta.home-manager;
};
};
}

View file

@ -30,6 +30,13 @@
firefox.enable = lib.mkEnableOption "firefox configuration";
rescrobbled.enable = lib.mkEnableOption "rescrobbled 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

View file

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

View file

@ -1,15 +1,25 @@
{ ... }: {
system.stateVersion = "24.05";
{ inputs, system, secrets, pkgs, ... }: {
imports = [
./environment.nix
home-manager.config = {
imports = [ ../../home-manager ];
# Import full home-manager config
../../home-manager
];
meta.home-manager.preset = "cli";
meta.home-manager = { preset = "cli"; interface = "nix-on-droid"; };
nix = {
extraOptions = ''
experimental-features = nix-command flakes
'';
nixPath = [ "nixpkgs=${inputs.nixpkgs}" ];
};
environment.etcBackupExtension = ".bak";
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";
};
nix.extraOptions = ''
experimental-features = nix-command flakes
'';
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
);
createDroidSystem = {
system ? "aarch64-linux",
entrypoint
}: inputs.nix-on-droid.lib.nixOnDroidConfiguration {
pkgs = import inputs.nixpkgs { inherit system; };
modules = [ entrypoint ];
extraSpecialArgs = {
inherit inputs system secrets;
};
};
}