mirror of
https://github.com/tuxdotrs/nix-config.git
synced 2026-09-19 16:49:04 +05:30
style: format code
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
{ inputs, ... }:
|
||||
{
|
||||
imports = [ inputs.flake-parts.flakeModules.modules ];
|
||||
{inputs, ...}: {
|
||||
imports = [inputs.flake-parts.flakeModules.modules];
|
||||
}
|
||||
|
||||
@@ -3,19 +3,18 @@
|
||||
inputs,
|
||||
config,
|
||||
...
|
||||
}:
|
||||
let
|
||||
mkNixOSHost =
|
||||
hostName:
|
||||
{
|
||||
userName ? "tux",
|
||||
userEmail ? "t@tux.rs",
|
||||
system ? "x86_64-linux",
|
||||
unstable ? true,
|
||||
}:
|
||||
let
|
||||
nixpkgs = if unstable then inputs.nixpkgs else inputs.nixpkgs-stable;
|
||||
in
|
||||
}: let
|
||||
mkNixOSHost = hostName: {
|
||||
userName ? "tux",
|
||||
userEmail ? "t@tux.rs",
|
||||
system ? "x86_64-linux",
|
||||
unstable ? true,
|
||||
}: let
|
||||
nixpkgs =
|
||||
if unstable
|
||||
then inputs.nixpkgs
|
||||
else inputs.nixpkgs-stable;
|
||||
in
|
||||
nixpkgs.lib.nixosSystem {
|
||||
inherit system;
|
||||
specialArgs = {
|
||||
@@ -32,17 +31,17 @@ let
|
||||
];
|
||||
};
|
||||
|
||||
mkDroidHost =
|
||||
hostName:
|
||||
{
|
||||
userName ? "nix-on-droid",
|
||||
userEmail ? "t@tux.rs",
|
||||
system ? "aarch64-linux",
|
||||
unstable ? true,
|
||||
}:
|
||||
let
|
||||
nixpkgs = if unstable then inputs.nixpkgs else inputs.nixpkgs-stable;
|
||||
in
|
||||
mkDroidHost = hostName: {
|
||||
userName ? "nix-on-droid",
|
||||
userEmail ? "t@tux.rs",
|
||||
system ? "aarch64-linux",
|
||||
unstable ? true,
|
||||
}: let
|
||||
nixpkgs =
|
||||
if unstable
|
||||
then inputs.nixpkgs
|
||||
else inputs.nixpkgs-stable;
|
||||
in
|
||||
inputs.nix-on-droid.lib.nixOnDroidConfiguration {
|
||||
pkgs = import nixpkgs {
|
||||
inherit system;
|
||||
@@ -65,66 +64,55 @@ let
|
||||
];
|
||||
};
|
||||
|
||||
mkNixOSNode =
|
||||
hostName:
|
||||
{
|
||||
system ? "x86_64-linux",
|
||||
}:
|
||||
{
|
||||
hostname = hostName;
|
||||
profiles.system = {
|
||||
user = "root";
|
||||
path = inputs.deploy-rs.lib.${system}.activate.nixos self.nixosConfigurations.${hostName};
|
||||
};
|
||||
mkNixOSNode = hostName: {system ? "x86_64-linux"}: {
|
||||
hostname = hostName;
|
||||
profiles.system = {
|
||||
user = "root";
|
||||
path = inputs.deploy-rs.lib.${system}.activate.nixos self.nixosConfigurations.${hostName};
|
||||
};
|
||||
};
|
||||
|
||||
activateNixOnDroid =
|
||||
system: configuration:
|
||||
activateNixOnDroid = system: configuration:
|
||||
inputs.deploy-rs.lib.${system}.activate.custom configuration.activationPackage
|
||||
"${configuration.activationPackage}/activate";
|
||||
"${configuration.activationPackage}/activate";
|
||||
|
||||
mkDroidNode =
|
||||
hostName:
|
||||
{
|
||||
system ? "aarch64-linux",
|
||||
}:
|
||||
{
|
||||
hostname = hostName;
|
||||
profiles.system = {
|
||||
sshUser = "nix-on-droid";
|
||||
user = "nix-on-droid";
|
||||
magicRollback = true;
|
||||
sshOpts = [
|
||||
"-p"
|
||||
"8033"
|
||||
];
|
||||
path = activateNixOnDroid system self.nixOnDroidConfigurations.${hostName};
|
||||
};
|
||||
mkDroidNode = hostName: {system ? "aarch64-linux"}: {
|
||||
hostname = hostName;
|
||||
profiles.system = {
|
||||
sshUser = "nix-on-droid";
|
||||
user = "nix-on-droid";
|
||||
magicRollback = true;
|
||||
sshOpts = [
|
||||
"-p"
|
||||
"8033"
|
||||
];
|
||||
path = activateNixOnDroid system self.nixOnDroidConfigurations.${hostName};
|
||||
};
|
||||
|
||||
in
|
||||
{
|
||||
};
|
||||
in {
|
||||
flake = {
|
||||
nixosConfigurations = builtins.mapAttrs mkNixOSHost {
|
||||
sirius = { };
|
||||
canopus = { };
|
||||
arcturus = { };
|
||||
alpha = { };
|
||||
vps = { };
|
||||
sirius = {};
|
||||
canopus = {};
|
||||
arcturus = {};
|
||||
alpha = {};
|
||||
vps = {};
|
||||
};
|
||||
|
||||
nixOnDroidConfigurations = builtins.mapAttrs mkDroidHost {
|
||||
vega = { };
|
||||
vega = {};
|
||||
};
|
||||
|
||||
deploy.nodes =
|
||||
builtins.mapAttrs (hostName: _: mkNixOSNode hostName { }) self.nixosConfigurations
|
||||
// builtins.mapAttrs (hostName: _: mkDroidNode hostName { }) self.nixOnDroidConfigurations;
|
||||
builtins.mapAttrs (hostName: _: mkNixOSNode hostName {}) self.nixosConfigurations
|
||||
// builtins.mapAttrs (hostName: _: mkDroidNode hostName {}) self.nixOnDroidConfigurations;
|
||||
};
|
||||
|
||||
perSystem = {
|
||||
checks = builtins.mapAttrs (
|
||||
_: hostConfig: hostConfig.config.system.build.toplevel
|
||||
) self.nixosConfigurations;
|
||||
checks =
|
||||
builtins.mapAttrs (
|
||||
_: hostConfig: hostConfig.config.system.build.toplevel
|
||||
)
|
||||
self.nixosConfigurations;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,8 +1,4 @@
|
||||
{
|
||||
inputs,
|
||||
...
|
||||
}:
|
||||
{
|
||||
{inputs, ...}: {
|
||||
flake.overlays = {
|
||||
modifications = final: prev: {
|
||||
tnvim = inputs.tnvim.packages.${prev.stdenv.hostPlatform.system}.default;
|
||||
@@ -31,12 +27,10 @@
|
||||
copyparty = inputs.copyparty.overlays.default;
|
||||
};
|
||||
|
||||
perSystem =
|
||||
{ system, ... }:
|
||||
{
|
||||
_module.args.pkgs = import inputs.nixpkgs {
|
||||
inherit system;
|
||||
overlays = builtins.attrValues inputs.self.overlays;
|
||||
};
|
||||
perSystem = {system, ...}: {
|
||||
_module.args.pkgs = import inputs.nixpkgs {
|
||||
inherit system;
|
||||
overlays = builtins.attrValues inputs.self.overlays;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
{ inputs, ... }:
|
||||
{
|
||||
{inputs, ...}: {
|
||||
imports = [
|
||||
inputs.treefmt-nix.flakeModule
|
||||
];
|
||||
@@ -9,7 +8,7 @@
|
||||
projectRootFile = "flake.nix";
|
||||
flakeCheck = true;
|
||||
programs = {
|
||||
nixfmt.enable = true;
|
||||
alejandra.enable = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user