more progress on custom options config
This commit is contained in:
26 files changed
+900
-561
No files matched your search
@@ -0,0 +1,85 @@
|
||||
{ inputs, self, ... }: {
|
||||
flake.nixosModules.global = { pkgs, config, lib, ... }: {
|
||||
system.stateVersion = config.info.stateVersion;
|
||||
|
||||
nix = {
|
||||
settings.experimental-features = [
|
||||
"nix-command"
|
||||
"flakes"
|
||||
];
|
||||
|
||||
gc = {
|
||||
automatic = true;
|
||||
persistent = true;
|
||||
dates = "Sun 05:00";
|
||||
};
|
||||
};
|
||||
|
||||
boot.loader.efi.canTouchEfiVariables = true;
|
||||
|
||||
networking = {
|
||||
networkmanager.enable = true;
|
||||
hostName = config.info.hostName;
|
||||
};
|
||||
|
||||
time.timeZone = "Europe/London";
|
||||
i18n = {
|
||||
defaultLocale = "en_GB.UTF-8";
|
||||
extraLocaleSettings = with config.i18n; {
|
||||
LC_ADDRESS = defaultLocale;
|
||||
LC_IDENTIFICATION = defaultLocale;
|
||||
LC_MEASUREMENT = defaultLocale;
|
||||
LC_MONETARY = defaultLocale;
|
||||
LC_NAME = defaultLocale;
|
||||
LC_NUMERIC = defaultLocale;
|
||||
LC_PAPER = defaultLocale;
|
||||
LC_TELEPHONE = defaultLocale;
|
||||
LC_TIME = defaultLocale;
|
||||
};
|
||||
};
|
||||
|
||||
services.xserver.xkb = {
|
||||
layout = "gb";
|
||||
variant = "";
|
||||
};
|
||||
|
||||
console.keyMap = "uk";
|
||||
|
||||
users.users."grey" = {
|
||||
isNormalUser = true;
|
||||
description = "grey";
|
||||
extraGroups = [ "networkmanager" "wheel" ];
|
||||
};
|
||||
|
||||
nixpkgs.config.allowUnfree = true;
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
git
|
||||
fzf
|
||||
jq
|
||||
busybox
|
||||
ethtool
|
||||
hyperfine
|
||||
] ++ config.features.applications.extraPackages;
|
||||
|
||||
programs = {
|
||||
nano = {
|
||||
enable = true;
|
||||
nanorc = ''
|
||||
set nowrap
|
||||
set tabstospaces
|
||||
set tabsize 2
|
||||
'';
|
||||
};
|
||||
|
||||
gnupg.agent = {
|
||||
enable = true;
|
||||
};
|
||||
};
|
||||
|
||||
hardware.bluetooth = {
|
||||
enable = true;
|
||||
powerOnBoot = false;
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
{ inputs, self, ... }: {
|
||||
flake.nixosModules.global = { pkgs, config, lib, ... }: {
|
||||
options.helpers = {
|
||||
mkSymlinkActivationScript = lib.mkOption {
|
||||
type = lib.types.functionTo lib.types.str;
|
||||
default = {target, source, isDir ? false}: ''
|
||||
if [ ${if isDir then "-d" else "-f"} /home/grey/${target} ]; then
|
||||
rm${if isDir then " -rf" else ""} /home/grey/${target}
|
||||
fi
|
||||
ln -s ${config.info.rootPath}/${source} /home/grey/${target}
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
{ inputs, self, ... }: {
|
||||
flake.homeModules.global = { osConfig, config, pkgs, ... }: {
|
||||
nix.gc = {
|
||||
automatic = true;
|
||||
persistent = true;
|
||||
dates = "Sun 05:00";
|
||||
};
|
||||
|
||||
home = {
|
||||
stateVersion = osConfig.info.stateVersion;
|
||||
|
||||
packages = with pkgs; [
|
||||
speedtest-go
|
||||
] ++ osConfig.features.applications.extraUserPackages;
|
||||
|
||||
shell.enableBashIntegration = true;
|
||||
};
|
||||
|
||||
programs = {
|
||||
git = {
|
||||
enable = true;
|
||||
|
||||
lfs.enable = true;
|
||||
|
||||
settings = {
|
||||
user.name = "Grey Jones";
|
||||
user.email = "grey@greyweather.dev";
|
||||
};
|
||||
|
||||
signing = {
|
||||
format = "openpgp";
|
||||
key = "CC7388DF8E1890729921BCFF7C67C51C2FF524D9";
|
||||
signByDefault = true;
|
||||
};
|
||||
};
|
||||
|
||||
gpg = {
|
||||
enable = true;
|
||||
};
|
||||
|
||||
ssh = {
|
||||
enable = true;
|
||||
enableDefaultConfig = false;
|
||||
settings = {
|
||||
"git.greyweather.dev" = {
|
||||
HostName = "git.greyweather.dev";
|
||||
Port = "222";
|
||||
User = "git";
|
||||
IdentityFile = "~/.ssh/id_gitea";
|
||||
};
|
||||
"github.com" = {
|
||||
HostName = "github.com";
|
||||
Port = 22;
|
||||
User = "git";
|
||||
IdentityFile = "~/.ssh/id_github";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
{ inputs, self, ... }: {
|
||||
flake.nixosModules.global = { pkgs, config, lib, ... }: {
|
||||
options = {
|
||||
info = {
|
||||
rootPath = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = "/home/grey/nixos";
|
||||
};
|
||||
|
||||
hostName = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = "";
|
||||
};
|
||||
|
||||
stateVersion = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = "";
|
||||
};
|
||||
};
|
||||
|
||||
components.bootLoader = lib.mkOption {
|
||||
type = lib.types.enum (map (name: lib.removeSuffix ".nix" name) (
|
||||
builtins.attrNames (builtins.readDir "${self}/modules/components/boot-loaders")
|
||||
));
|
||||
default = "grub";
|
||||
};
|
||||
|
||||
features.applications = {
|
||||
extraPackages = lib.mkOption {
|
||||
type = lib.types.listOf (lib.types.package);
|
||||
default = [];
|
||||
};
|
||||
|
||||
extraUserPackages = lib.mkOption {
|
||||
type = lib.types.listOf (lib.types.package);
|
||||
default = [];
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in new issue
Block a user