fix(droid): get build to work again
All checks were successful
Discord / discord commits (push) Has been skipped

This commit is contained in:
matt1432 2024-11-23 04:53:02 -05:00
parent 097df2b8be
commit fd1ae4fa32
8 changed files with 174 additions and 132 deletions

View file

@ -3,11 +3,11 @@
lib, lib,
pkgs, pkgs,
... ...
}: { }: let
inherit (lib) attrValues concatStringsSep;
in {
imports = [./nix-on-droid.nix]; imports = [./nix-on-droid.nix];
vars.mainUser = "nix-on-droid";
environment.variables.FLAKE = "/data/data/com.termux.nix/files/home/.nix"; environment.variables.FLAKE = "/data/data/com.termux.nix/files/home/.nix";
terminal.font = "${(pkgs.nerdfonts.override { terminal.font = "${(pkgs.nerdfonts.override {
@ -19,7 +19,8 @@
environment.packages = [ environment.packages = [
(pkgs.writeShellApplication { (pkgs.writeShellApplication {
name = "switch"; name = "switch";
runtimeInputs = builtins.attrValues {
runtimeInputs = attrValues {
inherit inherit
(pkgs) (pkgs)
coreutils coreutils
@ -27,10 +28,11 @@
nvd nvd
; ;
}; };
text = '' text = ''
oldProfile=$(realpath /nix/var/nix/profiles/per-user/nix-on-droid/profile) oldProfile=$(realpath /nix/var/nix/profiles/per-user/nix-on-droid/profile)
nix-on-droid ${lib.concatStringsSep " " [ nix-on-droid ${concatStringsSep " " [
"switch" "switch"
"--flake ${config.environment.variables.FLAKE}" "--flake ${config.environment.variables.FLAKE}"
"--builders ssh-ng://matt@100.64.0.7" "--builders ssh-ng://matt@100.64.0.7"

View file

@ -1,13 +1,16 @@
# FIXME: eval is broken
{ {
config, config,
self, self,
... ...
}: { }: {
imports = [ imports = [
../../common/vars self.nixosModules.base-droid
../../common/modules/global.nix {
../../common/packages.nix roles.base = {
enable = true;
user = "nix-on-droid";
};
}
self.nixosModules.tmux self.nixosModules.tmux
{programs.tmux.enableCustomConf = true;} {programs.tmux.enableCustomConf = true;}

View file

@ -0,0 +1,22 @@
self: {lib, ...}: let
inherit (lib) mkOption types;
in {
imports = [
(import ./common-nix self)
(import ./packages self)
];
options.roles.base = {
enable = mkOption {
type = types.bool;
default = true;
};
user = mkOption {
type = types.str;
};
};
# For accurate stack trace
_file = ./default.nix;
}

View file

@ -33,7 +33,7 @@ in {
}; };
}; };
config = mkIf (cfg.enable) { config = mkIf cfg.enable {
environment.variables.FLAKE = mkDefault "/home/${cfg.user}/.nix"; environment.variables.FLAKE = mkDefault "/home/${cfg.user}/.nix";
programs.tmux.enableCustomConf = true; programs.tmux.enableCustomConf = true;

View file

@ -1,4 +1,14 @@
{pkgs, ...}: { {
config,
lib,
pkgs,
...
}: let
inherit (lib) attrValues mkIf;
cfg = config.roles.base;
in
mkIf cfg.enable {
fonts = { fonts = {
fontconfig = { fontconfig = {
enable = true; enable = true;
@ -24,7 +34,7 @@
]; ];
}) })
] ]
++ (builtins.attrValues { ++ (attrValues {
inherit inherit
(pkgs) (pkgs)
noto-fonts noto-fonts
@ -42,4 +52,4 @@
# Select internationalisation properties. # Select internationalisation properties.
i18n.defaultLocale = "en_CA.UTF-8"; i18n.defaultLocale = "en_CA.UTF-8";
console.useXkbConfig = true; console.useXkbConfig = true;
} }

View file

@ -4,7 +4,7 @@
lib, lib,
... ...
}: let }: let
inherit (lib) concatStringsSep getName; inherit (lib) concatStringsSep getName mkIf;
baseCfg = config.roles.base; baseCfg = config.roles.base;
cfg = config.services.locate; cfg = config.services.locate;
@ -23,7 +23,8 @@
${updatedb} -o ${database} --prunefs "${pruneFS}" \ ${updatedb} -o ${database} --prunefs "${pruneFS}" \
--prunepaths "${prunePaths}" --prunenames "${pruneNames}" --prunepaths "${prunePaths}" --prunenames "${pruneNames}"
''; '';
in { in
mkIf (baseCfg.enable) {
users.users.${baseCfg.user}.extraGroups = [ users.users.${baseCfg.user}.extraGroups = [
locateGroup locateGroup
]; ];
@ -78,4 +79,4 @@ in {
".svn" ".svn"
]; ];
}; };
} }

View file

@ -4,7 +4,9 @@
pkgs, pkgs,
... ...
}: let }: let
inherit (lib) foldl isList mergeAttrsWithFunc optionals unique; inherit (lib) foldl isList mergeAttrsWithFunc mkIf optionals unique;
cfg = config.roles.base;
mergeAttrsList = list: mergeAttrsList = list:
foldl (mergeAttrsWithFunc (a: b: foldl (mergeAttrsWithFunc (a: b:
@ -12,7 +14,8 @@
then unique (a ++ b) then unique (a ++ b)
else b)) {} else b)) {}
list; list;
in { in
mkIf cfg.enable {
environment.systemPackages = [ environment.systemPackages = [
(pkgs.writeShellApplication { (pkgs.writeShellApplication {
name = "rebuild-no-cache"; name = "rebuild-no-cache";
@ -43,4 +46,4 @@ in {
(mkSubstituterConf "https://cache.nelim.org" "cache.nelim.org:JmFqkUdH11EA9EZOFAGVHuRYp7EbsdJDHvTQzG2pPyY=") (mkSubstituterConf "https://cache.nelim.org" "cache.nelim.org:JmFqkUdH11EA9EZOFAGVHuRYp7EbsdJDHvTQzG2pPyY=")
]); ]);
}; };
} }

View file

@ -1,5 +1,6 @@
self: { self: {
base = import ./base self; base = import ./base self;
base-droid = import ./base/default-droid.nix self;
borgbackup = import ./borgbackup; borgbackup = import ./borgbackup;
desktop = import ./desktop self; desktop = import ./desktop self;
docker = import ./docker self.inputs.khepri; docker = import ./docker self.inputs.khepri;