chore: cleanup all files
This commit is contained in:
parent
f4e47cbf97
commit
9cc9955425
43 changed files with 2893 additions and 2834 deletions
290
lib/default.nix
290
lib/default.nix
|
|
@ -1,144 +1,146 @@
|
|||
{
|
||||
inputs,
|
||||
lib,
|
||||
unstable,
|
||||
self,
|
||||
stable,
|
||||
system,
|
||||
...
|
||||
}: {
|
||||
/*
|
||||
*
|
||||
# buildSystems
|
||||
|
||||
Builds system given a list of system names which are placed within your hosts/ directory. Note that each system has its own directory in hosts/ as well.
|
||||
|
||||
A minimal configuration requires the file configuration.nix within each system directory, this will be the base config that is used across both NisOS and home-manager, specific optional files can also be added, hardware.nix for NisOS configuration and home.nix for home-manager configuration.
|
||||
|
||||
The second parameter is the root of your configuration, which should be ./. in most cases.
|
||||
|
||||
`root`
|
||||
|
||||
: the root path of your configuration
|
||||
|
||||
# Example usage
|
||||
:::{.example}
|
||||
```nix
|
||||
nixosConfigurations = buildSystems { root = ./.; };
|
||||
```
|
||||
:::
|
||||
*/
|
||||
# let
|
||||
# paths = builtins.readDir ;
|
||||
# names = lib.lists.remove "default" (
|
||||
# map (name: lib.strings.removeSuffix ".nix" name) (lib.attrsets.mapAttrsToList (name: _: name) paths)
|
||||
# );
|
||||
|
||||
# in
|
||||
buildSystems = {
|
||||
root,
|
||||
additionalMods ? {
|
||||
nixos = [];
|
||||
home = [];
|
||||
},
|
||||
mods ? {
|
||||
nixos = [
|
||||
inputs.lanzaboote.nixosModules.lanzaboote
|
||||
inputs.nixos-wsl.nixosModules.default
|
||||
inputs.home-manager.nixosModules.home-manager
|
||||
inputs.stylix.nixosModules.stylix
|
||||
inputs.disko.nixosModules.disko
|
||||
../base
|
||||
../home
|
||||
../modules
|
||||
];
|
||||
home = [
|
||||
inputs.anyrun.homeManagerModules.default
|
||||
inputs.ironbar.homeManagerModules.default
|
||||
inputs.oxicalc.homeManagerModules.default
|
||||
inputs.oxishut.homeManagerModules.default
|
||||
inputs.oxinoti.homeManagerModules.default
|
||||
inputs.oxidash.homeManagerModules.default
|
||||
inputs.oxipaste.homeManagerModules.default
|
||||
inputs.oxirun.homeManagerModules.default
|
||||
inputs.hyprdock.homeManagerModules.default
|
||||
inputs.hyprland.homeManagerModules.default
|
||||
inputs.reset.homeManagerModules.default
|
||||
inputs.sops-nix.homeManagerModules.sops
|
||||
inputs.dashvim.homeManagerModules.dashvim
|
||||
inputs.fancontrol.homeManagerModules.default
|
||||
../modules
|
||||
];
|
||||
},
|
||||
additionalInputs ? {},
|
||||
overridePkgs ? false,
|
||||
...
|
||||
}:
|
||||
builtins.listToAttrs (
|
||||
map
|
||||
(name: {
|
||||
name = name;
|
||||
value = let
|
||||
mod = root + /hosts/${name}/configuration.nix;
|
||||
additionalNixosConfig = root + /hosts/${name}/hardware.nix;
|
||||
additionalHomeConfig = root + /hosts/${name}/home.nix;
|
||||
args = {
|
||||
inherit
|
||||
self
|
||||
inputs
|
||||
mod
|
||||
additionalHomeConfig
|
||||
system
|
||||
root
|
||||
stable
|
||||
unstable
|
||||
;
|
||||
pkgs = lib.mkForce (
|
||||
if overridePkgs
|
||||
then stable
|
||||
else unstable
|
||||
);
|
||||
alternativePkgs =
|
||||
if overridePkgs
|
||||
then unstable
|
||||
else stable;
|
||||
hostName = name;
|
||||
homeMods = mods.home;
|
||||
additionalHomeMods = additionalMods.home;
|
||||
additionalInputs = additionalInputs;
|
||||
mkDashDefault = import ./override.nix {inherit lib;};
|
||||
};
|
||||
in
|
||||
inputs.unstable.lib.nixosSystem {
|
||||
modules =
|
||||
[
|
||||
{_module.args = args;}
|
||||
mod
|
||||
]
|
||||
++ mods.nixos
|
||||
++ additionalMods.nixos
|
||||
++ inputs.unstable.lib.optional (builtins.pathExists additionalNixosConfig) additionalNixosConfig
|
||||
++ inputs.unstable.lib.optional (builtins.pathExists mod) mod;
|
||||
};
|
||||
})
|
||||
(
|
||||
lib.lists.remove "" (
|
||||
lib.attrsets.mapAttrsToList (name: fType:
|
||||
if fType == "directory"
|
||||
then name
|
||||
else "") (
|
||||
builtins.readDir (root + /hosts)
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
buildIso = inputs.unstable.lib.nixosSystem {
|
||||
specialArgs = {
|
||||
inherit self inputs unstable;
|
||||
};
|
||||
modules = [
|
||||
../iso/configuration.nix
|
||||
];
|
||||
};
|
||||
}
|
||||
{
|
||||
inputs,
|
||||
lib,
|
||||
unstable,
|
||||
self,
|
||||
stable,
|
||||
system,
|
||||
dashNixAdditionalProps ? {},
|
||||
...
|
||||
}: {
|
||||
/*
|
||||
*
|
||||
# buildSystems
|
||||
|
||||
Builds system given a list of system names which are placed within your hosts/ directory. Note that each system has its own directory in hosts/ as well.
|
||||
|
||||
A minimal configuration requires the file configuration.nix within each system directory, this will be the base config that is used across both NisOS and home-manager, specific optional files can also be added, hardware.nix for NisOS configuration and home.nix for home-manager configuration.
|
||||
|
||||
The second parameter is the root of your configuration, which should be ./. in most cases.
|
||||
|
||||
`root`
|
||||
|
||||
: the root path of your configuration
|
||||
|
||||
# Example usage
|
||||
:::{.example}
|
||||
```nix
|
||||
nixosConfigurations = buildSystems { root = ./.; };
|
||||
```
|
||||
:::
|
||||
*/
|
||||
# let
|
||||
# paths = builtins.readDir ;
|
||||
# names = lib.lists.remove "default" (
|
||||
# map (name: lib.strings.removeSuffix ".nix" name) (lib.attrsets.mapAttrsToList (name: _: name) paths)
|
||||
# );
|
||||
|
||||
# in
|
||||
buildSystems = {
|
||||
root,
|
||||
additionalMods ? {
|
||||
nixos = [];
|
||||
home = [];
|
||||
},
|
||||
mods ? {
|
||||
nixos = [
|
||||
inputs.lanzaboote.nixosModules.lanzaboote
|
||||
inputs.nixos-wsl.nixosModules.default
|
||||
inputs.home-manager.nixosModules.home-manager
|
||||
inputs.stylix.nixosModules.stylix
|
||||
inputs.disko.nixosModules.disko
|
||||
../base
|
||||
../home
|
||||
../modules
|
||||
];
|
||||
home = [
|
||||
inputs.anyrun.homeManagerModules.default
|
||||
inputs.ironbar.homeManagerModules.default
|
||||
inputs.oxicalc.homeManagerModules.default
|
||||
inputs.oxishut.homeManagerModules.default
|
||||
inputs.oxinoti.homeManagerModules.default
|
||||
inputs.oxidash.homeManagerModules.default
|
||||
inputs.oxipaste.homeManagerModules.default
|
||||
inputs.oxirun.homeManagerModules.default
|
||||
inputs.hyprdock.homeManagerModules.default
|
||||
inputs.hyprland.homeManagerModules.default
|
||||
inputs.reset.homeManagerModules.default
|
||||
inputs.sops-nix.homeManagerModules.sops
|
||||
inputs.dashvim.homeManagerModules.dashvim
|
||||
inputs.fancontrol.homeManagerModules.default
|
||||
../modules
|
||||
];
|
||||
},
|
||||
additionalInputs ? {},
|
||||
overridePkgs ? false,
|
||||
...
|
||||
}:
|
||||
builtins.listToAttrs (
|
||||
map
|
||||
(name: {
|
||||
name = name;
|
||||
value = let
|
||||
mod = root + /hosts/${name}/configuration.nix;
|
||||
additionalNixosConfig = root + /hosts/${name}/hardware.nix;
|
||||
additionalHomeConfig = root + /hosts/${name}/home.nix;
|
||||
args = {
|
||||
inherit
|
||||
self
|
||||
inputs
|
||||
mod
|
||||
additionalHomeConfig
|
||||
system
|
||||
root
|
||||
stable
|
||||
unstable
|
||||
additionalInputs
|
||||
dashNixAdditionalProps
|
||||
;
|
||||
pkgs = lib.mkForce (
|
||||
if overridePkgs
|
||||
then stable
|
||||
else unstable
|
||||
);
|
||||
alternativePkgs =
|
||||
if overridePkgs
|
||||
then unstable
|
||||
else stable;
|
||||
hostName = name;
|
||||
homeMods = mods.home;
|
||||
additionalHomeMods = additionalMods.home;
|
||||
mkDashDefault = import ./override.nix {inherit lib;};
|
||||
};
|
||||
in
|
||||
inputs.unstable.lib.nixosSystem {
|
||||
modules =
|
||||
[
|
||||
{_module.args = args;}
|
||||
mod
|
||||
]
|
||||
++ mods.nixos
|
||||
++ additionalMods.nixos
|
||||
++ inputs.unstable.lib.optional (builtins.pathExists additionalNixosConfig) additionalNixosConfig
|
||||
++ inputs.unstable.lib.optional (builtins.pathExists mod) mod;
|
||||
};
|
||||
})
|
||||
(
|
||||
lib.lists.remove "" (
|
||||
lib.attrsets.mapAttrsToList (name: fType:
|
||||
if fType == "directory"
|
||||
then name
|
||||
else "") (
|
||||
builtins.readDir (root + /hosts)
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
buildIso = inputs.unstable.lib.nixosSystem {
|
||||
specialArgs = {
|
||||
inherit self inputs unstable;
|
||||
};
|
||||
modules = [
|
||||
../iso/configuration.nix
|
||||
];
|
||||
};
|
||||
}
|
||||
|
|
|
|||
53
lib/foxextensions.nix
Normal file
53
lib/foxextensions.nix
Normal file
|
|
@ -0,0 +1,53 @@
|
|||
{
|
||||
lib,
|
||||
dashNixAdditionalProps,
|
||||
pkgs,
|
||||
name,
|
||||
...
|
||||
}: let
|
||||
mkExtension = id: install_url: {
|
||||
${id} = {
|
||||
inherit install_url;
|
||||
installation_mode = "normal_installed";
|
||||
};
|
||||
};
|
||||
in {
|
||||
options.mods.browser.${name}.extensions = lib.mkOption {
|
||||
default = [
|
||||
(mkExtension "uBlock0@raymondhill.net" "https://addons.mozilla.org/firefox/downloads/latest/ublock-origin/latest.xpi")
|
||||
(mkExtension "{a6c4a591-f1b2-4f03-b3ff-767e5bedf4e7}" "https://addons.mozilla.org/firefox/downloads/latest/user-agent-string-switcher/latest.xpi")
|
||||
(mkExtension "{d7742d87-e61d-4b78-b8a1-b469842139fa}" "https://addons.mozilla.org/firefox/downloads/latest/vimium-ff/latest.xpi")
|
||||
(mkExtension "firefox@ghostery.com" "https://addons.mozilla.org/firefox/downloads/latest/ghostery/latest.xpi")
|
||||
(mkExtension "CanvasBlocker@kkapsner.de" "https://addons.mozilla.org/firefox/downloads/latest/canvasblocker/latest.xpi")
|
||||
(mkExtension "jid1-KKzOGWgsW3Ao4Q@jetpack" "https://addons.mozilla.org/firefox/downloads/latest/i-dont-care-about-cookies/latest.xpi")
|
||||
(mkExtension "keepassxc-browser@keepassxc.org" "https://addons.mozilla.org/firefox/downloads/latest/keepassxc-browser/latest.xpi")
|
||||
(mkExtension "@react-devtools" "https://addons.mozilla.org/firefox/downloads/latest/react-devtools/latest.xpi")
|
||||
(mkExtension "extension@redux.devtools" "https://addons.mozilla.org/firefox/downloads/latest/reduxdevtools/latest.xpi")
|
||||
(mkExtension "private-relay@firefox.com" "https://addons.mozilla.org/firefox/downloads/latest/private-relay/latest.xpi")
|
||||
(mkExtension "addon@darkreader.org" "file://${pkgs.callPackage ../patches/darkreader.nix {inherit lib dashNixAdditionalProps;}}/latest.xpi")
|
||||
];
|
||||
example = [
|
||||
{
|
||||
"78272b6fa58f4a1abaac99321d503a20@proton.me" = {
|
||||
install_url = "https://addons.mozilla.org/en-US/firefox/downloads/latest/proton-pass/latest.xpi";
|
||||
installation_mode = "normal_installed";
|
||||
};
|
||||
}
|
||||
];
|
||||
type = with lib.types; listOf anything;
|
||||
description = ''
|
||||
List of extensions via attrsets:
|
||||
```nix
|
||||
# id
|
||||
# figure out the id via:
|
||||
# nix run github:tupakkatapa/mozid -- 'https://addons.mozilla.org/en/firefox/addon/ublock-origin'
|
||||
"uBlock0@raymondhill.net" = {
|
||||
# install url
|
||||
install_url = "https://addons.mozilla.org/firefox/downloads/latest/ublock-origin/latest.xpi";
|
||||
# method https://mozilla.github.io/policy-templates/#extensionsettings
|
||||
installation_mode = "force_installed";
|
||||
};
|
||||
```
|
||||
'';
|
||||
};
|
||||
}
|
||||
17
lib/importPkgs.nix
Normal file
17
lib/importPkgs.nix
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
{
|
||||
inputs,
|
||||
currentSystem,
|
||||
permittedPackages,
|
||||
pkgs,
|
||||
}:
|
||||
import pkgs {
|
||||
system = currentSystem;
|
||||
config = {
|
||||
allowUnfree = true;
|
||||
permittedInsecurePackages = permittedPackages;
|
||||
};
|
||||
overlays = [
|
||||
inputs.nur.overlays.default
|
||||
inputs.chaoticNyx.overlays.default
|
||||
];
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue