mirror of
https://github.com/donovanglover/nix-config.git
synced 2025-01-10 07:58:30 +01:00
phone: Move phone-specific config out of system
This commit is contained in:
parent
2cd3aaf869
commit
86a786cf1f
@ -30,6 +30,10 @@ in
|
|||||||
xdg-user-dirs
|
xdg-user-dirs
|
||||||
xresources
|
xresources
|
||||||
;
|
;
|
||||||
|
|
||||||
|
config = {
|
||||||
|
programs.man.generateCaches = lib.mkForce false;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
environment.systemPackages = attrValues {
|
environment.systemPackages = attrValues {
|
||||||
@ -65,18 +69,10 @@ in
|
|||||||
system = {
|
system = {
|
||||||
hostName = "mobile-nixos";
|
hostName = "mobile-nixos";
|
||||||
stateVersion = "23.11";
|
stateVersion = "23.11";
|
||||||
phone = true;
|
mullvad = true;
|
||||||
};
|
|
||||||
|
|
||||||
desktop = {
|
|
||||||
phone = true;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
hardware.keyboardBinds = true;
|
hardware.keyboardBinds = true;
|
||||||
|
|
||||||
system = {
|
|
||||||
mullvad = true;
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
hardware.graphics.enable32Bit = lib.mkForce false;
|
hardware.graphics.enable32Bit = lib.mkForce false;
|
||||||
@ -100,6 +96,11 @@ in
|
|||||||
udisks2.enable = lib.mkForce false;
|
udisks2.enable = lib.mkForce false;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
boot.binfmt.emulatedSystems = lib.mkForce [ ];
|
||||||
|
boot.loader.systemd-boot.enable = lib.mkForce false;
|
||||||
|
networking.firewall.checkReversePath = lib.mkForce false;
|
||||||
|
documentation.man.generateCaches = false;
|
||||||
|
|
||||||
powerManagement = {
|
powerManagement = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
let
|
let
|
||||||
inherit (lib) mkOption mkEnableOption mkIf singleton optionals;
|
inherit (lib) mkOption mkEnableOption mkIf singleton optionals;
|
||||||
inherit (lib.types) nullOr str listOf;
|
inherit (lib.types) nullOr str listOf;
|
||||||
inherit (cfg) username iHaveLotsOfRam hashedPassword mullvad allowSRB2Port allowDevPort noRoot postgres phone;
|
inherit (cfg) username iHaveLotsOfRam hashedPassword mullvad allowSRB2Port allowDevPort noRoot postgres;
|
||||||
inherit (builtins) attrValues;
|
inherit (builtins) attrValues;
|
||||||
|
|
||||||
cfg = config.modules.system;
|
cfg = config.modules.system;
|
||||||
@ -45,7 +45,6 @@ in
|
|||||||
};
|
};
|
||||||
|
|
||||||
iHaveLotsOfRam = mkEnableOption "tmpfs on /tmp";
|
iHaveLotsOfRam = mkEnableOption "tmpfs on /tmp";
|
||||||
phone = mkEnableOption "Phone support";
|
|
||||||
|
|
||||||
hostName = mkOption {
|
hostName = mkOption {
|
||||||
type = str;
|
type = str;
|
||||||
@ -62,7 +61,7 @@ in
|
|||||||
};
|
};
|
||||||
|
|
||||||
config = {
|
config = {
|
||||||
boot = mkIf (!phone) {
|
boot = {
|
||||||
tmp =
|
tmp =
|
||||||
if iHaveLotsOfRam
|
if iHaveLotsOfRam
|
||||||
then { useTmpfs = true; }
|
then { useTmpfs = true; }
|
||||||
@ -138,16 +137,13 @@ in
|
|||||||
else [
|
else [
|
||||||
"wheel"
|
"wheel"
|
||||||
"networkmanager"
|
"networkmanager"
|
||||||
] ++ (optionals (phone) [
|
|
||||||
"dialout"
|
"dialout"
|
||||||
"feedbackd"
|
"feedbackd"
|
||||||
"video"
|
"video"
|
||||||
]);
|
];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
documentation.man.generateCaches = mkIf (phone) false;
|
|
||||||
|
|
||||||
home-manager = {
|
home-manager = {
|
||||||
useGlobalPkgs = true;
|
useGlobalPkgs = true;
|
||||||
useUserPackages = true;
|
useUserPackages = true;
|
||||||
@ -157,7 +153,7 @@ in
|
|||||||
inherit (cfg) stateVersion;
|
inherit (cfg) stateVersion;
|
||||||
};
|
};
|
||||||
|
|
||||||
programs.man.generateCaches = mkIf (!phone) true;
|
programs.man.generateCaches = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
users.${username}.home = {
|
users.${username}.home = {
|
||||||
@ -233,8 +229,6 @@ in
|
|||||||
allowedTCPPorts = mkIf allowDevPort [
|
allowedTCPPorts = mkIf allowDevPort [
|
||||||
3000
|
3000
|
||||||
];
|
];
|
||||||
|
|
||||||
checkReversePath = mkIf phone (lib.mkForce false);
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user