Skip to content

Commit

Permalink
Use alejandra formatter / fix warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
DashieTM committed Feb 15, 2025
1 parent c5b1041 commit 693d4e3
Show file tree
Hide file tree
Showing 70 changed files with 1,421 additions and 1,544 deletions.
30 changes: 16 additions & 14 deletions base/common_hardware.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@
hostName,
modulesPath,
...
}:
let
}: let
username = config.conf.username;
in
{
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
in {
imports = [
(modulesPath + "/installer/scan/not-detected.nix")
#(modulesPath + "/misc/nixpkgs/read-only.nix")
];

# Bootloader.
boot = {
Expand All @@ -34,11 +35,13 @@ in
"sd_mod"
];
};
kernelParams = [
''resume="PARTLABEL=SWAP"''
''quiet''
''udev.log_level=3''
] ++ config.conf.bootParams;
kernelParams =
[
''resume="PARTLABEL=SWAP"''
''quiet''
''udev.log_level=3''
]
++ config.conf.bootParams;
};

# Enable networking
Expand All @@ -59,6 +62,8 @@ in
flatpak.enable = true;
xserver.enable = true;
fstrim.enable = lib.mkDefault true;
# Enable sound with pipewire.
pulseaudio.enable = false;
pipewire = {
enable = true;
alsa = {
Expand All @@ -78,16 +83,14 @@ in
options = "--delete-older-than 7d --delete-generations +5";
};
settings = {
trusted-users = [ username ];
trusted-users = [username];
auto-optimise-store = true;

experimental-features = "nix-command flakes";
};
};

# Enable sound with pipewire.
hardware = {
pulseaudio.enable = false;
cpu.${config.conf.cpu}.updateMicrocode =
lib.mkDefault config.hardware.enableRedistributableFirmware;
};
Expand Down Expand Up @@ -124,5 +127,4 @@ in
password = "firstlogin";
};
};

}
5 changes: 4 additions & 1 deletion base/env.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
{ pkgs, config, ... }:
{
pkgs,
config,
...
}: {
environment = {
variables = {
GSETTINGS_SCHEMA_DIR = "${pkgs.glib.getSchemaPath pkgs.gsettings-desktop-schemas}";
Expand Down
10 changes: 4 additions & 6 deletions base/xkb_layout.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{ pkgs, ... }:
let
{pkgs, ...}: let
layout = pkgs.writeText "dashie" ''
xkb_symbols "dashie"
{
Expand All @@ -10,12 +9,11 @@ let
key <AD07> { [ u, U, udiaeresis, Udiaeresis ] };
};
'';
in
{
environment.systemPackages = [ pkgs.xorg.xkbcomp ];
in {
environment.systemPackages = [pkgs.xorg.xkbcomp];
services.xserver.xkb.extraLayouts.dashie = {
description = "US layout with 'umlaut'";
languages = [ "eng" ];
languages = ["eng"];
symbolsFile = "${layout}";
};
}
35 changes: 17 additions & 18 deletions docs/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,17 @@
build_systems,
lib,
...
}:
let
makeOptionsDoc = configuration: pkgs.nixosOptionsDoc { options = configuration; };
}: let
makeOptionsDoc = configuration: pkgs.nixosOptionsDoc {options = configuration;};
generateDocs = obj: ''
touch src/${obj.fst}.md
sed '/*Declared by:*/,/^$/d' <${obj.snd.optionsCommonMark} >> src/${obj.fst}.md
'';
summaryAppend = name: ''
echo "- [${name}](${name}.md)" >> src/SUMMARY.md
'';
system = (build_systems { root = ../example/.; })."example".options;
makeOptionsDocPrograms = name: pkgs.nixosOptionsDoc { options = system.mods.${name}; };
system = (build_systems {root = ../example/.;})."example".options;
makeOptionsDocPrograms = name: pkgs.nixosOptionsDoc {options = system.mods.${name};};
conf = makeOptionsDoc system.conf;
paths = builtins.readDir ../modules/programs;
names = lib.lists.remove "default" (
Expand All @@ -25,18 +24,18 @@ let
docs = lib.strings.concatLines (map generateDocs (lib.lists.zipLists names mods));
summary = lib.strings.concatStringsSep " " (map summaryAppend names);
in
pkgs.stdenvNoCC.mkDerivation {
name = "dashNix-book";
src = ./.;
pkgs.stdenvNoCC.mkDerivation {
name = "dashNix-book";
src = ./.;

patchPhase = ''
sed '/*Declared by:*/,/^$/d' <${conf.optionsCommonMark} >> src/conf.md
${docs}
echo "[README](README.md)\n # Options\n - [Base Config](conf.md)" >> src/SUMMARY.md
${summary}
'';
patchPhase = ''
sed '/*Declared by:*/,/^$/d' <${conf.optionsCommonMark} >> src/conf.md
${docs}
echo "[README](README.md)\n # Options\n - [Base Config](conf.md)" >> src/SUMMARY.md
${summary}
'';

buildPhase = ''
${pkgs.mdbook}/bin/mdbook build --dest-dir $out
'';
}
buildPhase = ''
${pkgs.mdbook}/bin/mdbook build --dest-dir $out
'';
}
8 changes: 3 additions & 5 deletions example/flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,9 @@
};
};

outputs =
{ ... }@inputs:
{
nixosConfigurations = inputs.dashNix.dashNixLib.build_systems { root = ./.; };
};
outputs = {...} @ inputs: {
nixosConfigurations = inputs.dashNix.dashNixLib.build_systems {root = ./.;};
};

nixConfig = {
builders-use-substitutes = true;
Expand Down
3 changes: 1 addition & 2 deletions example/hosts/example/configuration.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{ config, ... }:
{
{config, ...}: {
# variables for system
# TODO important changes
conf = {
Expand Down
110 changes: 53 additions & 57 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -48,66 +48,62 @@
};
};

outputs =
{ self, ... }@inputs:
let
permittedPackages = [
"olm-3.2.16"
# well done dotnet...
# this is just for omnisharp
"dotnet-core-combined"
"dotnet-wrapped-combined"
"dotnet-combined"
"dotnet-sdk-6.0.428"
"dotnet-sdk-wrapped-6.0.428"
"dotnet-sdk-6.0.136"
"dotnet-sdk-wrapped-6.0.136"
"dotnet-sdk-7.0.120"
"dotnet-sdk-wrapped-7.0.120"
"dotnet-sdk-7.0.410"
"dotnet-sdk-wrapped-7.0.410"
"jitsi-meet-1.0.8043"
"nextcloud-27.1.11"
];
stable = import inputs.stable {
system = "x86_64-linux";
config = {
allowUnfree = true;
allowBroken = true;
permittedInsecurePackages = permittedPackages;
};
};
pkgs = import inputs.nixpkgs {
system = "x86_64-linux";
config = {
allowUnsupportedSystem = true;
permittedInsecurePackages = permittedPackages;
allowBroken = true;
allowUnfree = true;
};
};
in
rec {
dashNixLib = import ./lib {
inherit
self
inputs
pkgs
stable
;
lib = inputs.nixpkgs.lib;
outputs = {self, ...} @ inputs: let
permittedPackages = [
"olm-3.2.16"
# well done dotnet...
# this is just for omnisharp
"dotnet-core-combined"
"dotnet-wrapped-combined"
"dotnet-combined"
"dotnet-sdk-6.0.428"
"dotnet-sdk-wrapped-6.0.428"
"dotnet-sdk-6.0.136"
"dotnet-sdk-wrapped-6.0.136"
"dotnet-sdk-7.0.120"
"dotnet-sdk-wrapped-7.0.120"
"dotnet-sdk-7.0.410"
"dotnet-sdk-wrapped-7.0.410"
"jitsi-meet-1.0.8043"
"nextcloud-27.1.11"
];
stable = import inputs.stable {
system = "x86_64-linux";
config = {
allowUnfree = true;
permittedInsecurePackages = permittedPackages;
};
docs = import ./docs {
inherit inputs pkgs stable;
lib = inputs.nixpkgs.lib;
build_systems = dashNixLib.build_systems;
};
pkgs = import inputs.nixpkgs {
system = "x86_64-linux";
config = {
allowUnsupportedSystem = true;
permittedInsecurePackages = permittedPackages;
allowBroken = true;
allowUnfree = true;
};
dashNixInputs = inputs;
stablePkgs = stable;
unstablePkgs = pkgs;
modules = ./modules;
iso = dashNixLib.buildIso.config.system.build.isoImage;
};
in rec {
dashNixLib = import ./lib {
inherit
self
inputs
pkgs
stable
;
lib = inputs.nixpkgs.lib;
};
docs = import ./docs {
inherit inputs pkgs stable;
lib = inputs.nixpkgs.lib;
build_systems = dashNixLib.build_systems;
};
dashNixInputs = inputs;
stablePkgs = stable;
unstablePkgs = pkgs;
modules = ./modules;
iso = dashNixLib.buildIso.config.system.build.isoImage;
};

nixConfig = {
builders-use-substitutes = true;
Expand Down
8 changes: 3 additions & 5 deletions home/common.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,9 @@
config,
lib,
...
}:
let
}: let
username = config.conf.username;
in
{
in {
manual = {
html.enable = false;
json.enable = false;
Expand All @@ -18,7 +16,7 @@ in
home = {
username = username;
homeDirectory = "/home/${username}";
sessionPath = [ "$HOME/.cargo/bin" ];
sessionPath = ["$HOME/.cargo/bin"];

enableNixpkgsReleaseCheck = false;
sessionVariables = {
Expand Down
17 changes: 8 additions & 9 deletions home/default.nix
Original file line number Diff line number Diff line change
@@ -1,22 +1,21 @@
{
inputs,
pkgs,
config,
lib,
mod,
additionalHomeConfig,
homeMods,
additionalHomeMods,
additionalInputs,
config,
homeMods,
inputs,
lib,
mod,
pkgs,
root,
...
}:
{
}: {
xdg = {
portal.config.common.default = "*";
portal = {
enable = true;
extraPortals = [ pkgs.xdg-desktop-portal-gtk ];
extraPortals = [pkgs.xdg-desktop-portal-gtk];
};
};
home-manager = {
Expand Down
Loading

0 comments on commit 693d4e3

Please sign in to comment.