building
This commit is contained in:
parent
d088d31c37
commit
d7c1e54788
9 changed files with 54 additions and 34 deletions
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
result
|
||||
|
|
@ -17,6 +17,4 @@
|
|||
];
|
||||
|
||||
boot.initrd.allowMissingModules = true;
|
||||
|
||||
nixpkgs.config.allowBroken = true;
|
||||
}
|
||||
|
|
|
|||
51
flake.nix
51
flake.nix
|
|
@ -73,31 +73,35 @@
|
|||
inherit (info) system;
|
||||
specialArgs = {
|
||||
inherit inputs dirUtils;
|
||||
isDesktop = info.isDesktop or false;
|
||||
inherit (info) type;
|
||||
|
||||
crossPkgs = import inputs.nixpkgs {
|
||||
hostPlatform = info.system;
|
||||
localSystem = info.system;
|
||||
buildPlatform = "x86_64-linux";
|
||||
|
||||
overlays = let
|
||||
overlays = lib.filesystem.listFilesRecursive ./cross-overlays/${info.hostname};
|
||||
in
|
||||
map (file: import file inputs) overlays;
|
||||
overlays = let path = ./cross-overlays/${info.hostname}; in dirUtils.opt (builtins.pathExists path) (map (file: import file inputs) (lib.filesystem.listFilesRecursive path));
|
||||
|
||||
config.permittedInsecurePackages = [
|
||||
"libsoup-2.74.3"
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
modules = with dirUtils;
|
||||
modules = let
|
||||
clientPath = ./clients/${info.hostname};
|
||||
in
|
||||
with dirUtils;
|
||||
[
|
||||
./wrappers/default.nix
|
||||
{networking.hostName = info.hostname;}
|
||||
inputs.agenix.nixosModules.default
|
||||
inputs.run0-sudo-shim.nixosModules.default
|
||||
]
|
||||
++ dirFiles ".nix" ./clients/${info.hostname}
|
||||
++ dirFiles ".nix" ./modules/common
|
||||
++ opt (info.isServer or false) (dirFiles ".nix" ./modules/server)
|
||||
++ opt (info.isDesktop or false) (dirFiles ".nix" ./modules/desktop)
|
||||
++ opt (info.isGraphical or info.isDesktop or false) (
|
||||
++ dirFiles ".nix" ./modules/${info.type}
|
||||
++ opt (builtins.pathExists clientPath) (dirFiles ".nix" clientPath)
|
||||
++ opt info.graphical (
|
||||
(dirFiles ".nix" ./modules/graphical)
|
||||
++ [
|
||||
inputs.home-manager.nixosModules.home-manager
|
||||
|
|
@ -117,17 +121,32 @@
|
|||
program = pkgs.writeShellApplication {
|
||||
name = "image";
|
||||
runtimeInputs = with pkgs; [nix-output-monitor];
|
||||
text = "nom build .#nixosConfigurations.quadphone.config.system.build.image";
|
||||
text = "nom build .#nixosConfigurations.\"$1\".config.system.build.image";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
flake.nixosConfigurations = builtins.mapAttrs (name: value: system ({system = "x86_64-linux";} // value // {hostname = name;})) {
|
||||
"quadraticpc".isDesktop = true;
|
||||
"quadtop".isDesktop = true;
|
||||
"quadraticserver".isServer = true;
|
||||
flake.nixosConfigurations = builtins.mapAttrs (name: value:
|
||||
system (
|
||||
{
|
||||
system = "x86_64-linux";
|
||||
graphical = true;
|
||||
hostname = name;
|
||||
}
|
||||
// value
|
||||
)) {
|
||||
"quadraticpc".type = "desktop";
|
||||
"quadtop".type = "desktop";
|
||||
"quadraticserver" = {
|
||||
type = "server";
|
||||
graphical = false;
|
||||
};
|
||||
"quadphone" = {
|
||||
isGraphical = true;
|
||||
type = "mobile";
|
||||
system = "aarch64-linux";
|
||||
};
|
||||
"everquad" = {
|
||||
type = "mobile";
|
||||
system = "aarch64-linux";
|
||||
};
|
||||
};
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
inkscape
|
||||
libreoffice
|
||||
authenticator
|
||||
cinny-desktop
|
||||
prismlauncher
|
||||
cinny-desktop
|
||||
];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,5 +9,6 @@
|
|||
wl-clipboard
|
||||
google-cursor
|
||||
papirus-icon-theme
|
||||
# crossPkgs.cinny-desktop
|
||||
];
|
||||
}
|
||||
|
|
|
|||
1
modules/mobile/allow-broken.nix
Normal file
1
modules/mobile/allow-broken.nix
Normal file
|
|
@ -0,0 +1 @@
|
|||
{nixpkgs.config.allowBroken = true;}
|
||||
19
modules/mobile/gnome.nix
Normal file
19
modules/mobile/gnome.nix
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
{crossPkgs, ...}: {
|
||||
nixpkgs.overlays = [
|
||||
(self: super: {
|
||||
gnome-shell = crossPkgs.gnome-shell;
|
||||
gnome-settings-daemon-mobile = crossPkgs.gnome-settings-daemon-mobile;
|
||||
mutter = crossPkgs.mutter;
|
||||
})
|
||||
];
|
||||
|
||||
i18n.inputMethod = {
|
||||
enable = true;
|
||||
type = "ibus";
|
||||
};
|
||||
|
||||
services.logind = {
|
||||
powerKey = "ignore";
|
||||
powerKeyLongPress = "poweroff";
|
||||
};
|
||||
}
|
||||
83
modules/mobile/repart.nix
Normal file
83
modules/mobile/repart.nix
Normal file
|
|
@ -0,0 +1,83 @@
|
|||
{
|
||||
modulesPath,
|
||||
crossPkgs,
|
||||
pkgs,
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
efiArch = pkgs.stdenv.hostPlatform.efiArch;
|
||||
in {
|
||||
imports = ["${modulesPath}/image/repart.nix"];
|
||||
boot.loader.grub.enable = false;
|
||||
|
||||
systemd.repart = {
|
||||
enable = true;
|
||||
partitions."03-root".Type = "root";
|
||||
};
|
||||
|
||||
boot.initrd = {
|
||||
supportedFilesystems.ext4 = true;
|
||||
systemd = {
|
||||
enable = true;
|
||||
root = "gpt-auto";
|
||||
};
|
||||
};
|
||||
|
||||
fileSystems = {
|
||||
"/" = {
|
||||
device = "/dev/disk/by-label/nixos";
|
||||
fsType = "ext4";
|
||||
};
|
||||
"/boot" = {
|
||||
device = "/dev/disk/by-label/ESP";
|
||||
fsType = "vfat";
|
||||
};
|
||||
};
|
||||
|
||||
image.repart = {
|
||||
name = "image";
|
||||
partitions = {
|
||||
"10-uboot-padding" = {
|
||||
repartConfig = {
|
||||
Type = "linux-generic";
|
||||
Label = "uboot-padding";
|
||||
SizeMinBytes = "10M";
|
||||
};
|
||||
};
|
||||
"20-esp" = {
|
||||
contents = {
|
||||
"/EFI/EDK2-UEFI-SHELL/SHELL.EFI".source = "${crossPkgs.edk2-uefi-shell.overrideAttrs {env.NIX_CFLAGS_COMPILE = "-Wno-error=maybe-uninitialized";}}/shell.efi";
|
||||
"/EFI/BOOT/BOOT${lib.toUpper efiArch}.EFI".source = "${pkgs.systemd}/lib/systemd/boot/efi/systemd-boot${efiArch}.efi";
|
||||
"/EFI/Linux/${config.system.boot.loader.ukiFile}".source = "${config.system.build.uki}/${config.system.boot.loader.ukiFile}";
|
||||
"/loader/loader.conf".source = crossPkgs.writeText "loader.conf" ''
|
||||
timeout 5
|
||||
console-mode keep
|
||||
'';
|
||||
"/loader/entries/shell.conf".source = crossPkgs.writeText "shell.conf" ''
|
||||
title EDK2 UEFI Shell
|
||||
efi /EFI/EDK2-UEFI-SHELL/SHELL.EFI
|
||||
'';
|
||||
};
|
||||
repartConfig = {
|
||||
Type = "esp";
|
||||
Format = "vfat";
|
||||
Label = "ESP";
|
||||
SizeMinBytes = "500M";
|
||||
GrowFileSystem = true;
|
||||
};
|
||||
};
|
||||
"30-root" = {
|
||||
storePaths = [config.system.build.toplevel];
|
||||
contents."/boot".source = crossPkgs.runCommand "boot" {} "mkdir $out";
|
||||
repartConfig = {
|
||||
Type = "root";
|
||||
Format = "ext4";
|
||||
Label = "nixos";
|
||||
Minimize = "guess";
|
||||
GrowFileSystem = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
@ -2,14 +2,14 @@
|
|||
pkgs,
|
||||
inputs,
|
||||
dirUtils,
|
||||
isDesktop,
|
||||
type,
|
||||
...
|
||||
}: {
|
||||
environment.systemPackages = [
|
||||
(inputs.wrapper-manager.lib {
|
||||
inherit pkgs;
|
||||
specialArgs = {inherit inputs;};
|
||||
modules = with dirUtils; dirFiles ".nix" ./common ++ opt isDesktop (dirFiles ".nix" ./desktop);
|
||||
modules = with dirUtils; dirFiles ".nix" ./common ++ opt (type == "desktop") (dirFiles ".nix" ./desktop);
|
||||
})
|
||||
.config.build.toplevel
|
||||
];
|
||||
|
|
|
|||
Loading…
Reference in a new issue