summaryrefslogtreecommitdiffstats
path: root/flake
diff options
context:
space:
mode:
Diffstat (limited to 'flake')
-rw-r--r--flake/default.nix118
-rw-r--r--flake/packages/default.nix97
-rw-r--r--flake/treefmt.nix95
3 files changed, 0 insertions, 310 deletions
diff --git a/flake/default.nix b/flake/default.nix
deleted file mode 100644
index 099a4568..00000000
--- a/flake/default.nix
+++ /dev/null
@@ -1,118 +0,0 @@
-# nixos-config - My current NixOS configuration
-#
-# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de>
-# SPDX-License-Identifier: GPL-3.0-or-later
-#
-# This file is part of my nixos-config.
-#
-# You should have received a copy of the License along with this program.
-# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>.
-{
- self,
- sources,
- nixpkgs,
- system,
- openPRsNixpkgs,
- packageSets,
- libraries,
- modules,
- externalDependencies,
- externalBinaries,
-}: let
- # Unpack common stuff.
- nixLib = libraries.extra;
- pkgs = packageSets.unstable;
-
- treefmtEval = import ./treefmt.nix {
- inherit (externalDependencies) treefmt-nix;
- inherit pkgs;
- };
-
- nixosConfigurations = import ../hosts {
- inherit
- self
- sources
- nixpkgs
- system
- openPRsNixpkgs
- packageSets
- libraries
- modules
- externalDependencies
- externalBinaries
- ;
- };
-
- tests = import ../tests {
- inherit pkgs nixLib openPRsNixpkgs system;
- myPkgs = packageSets.soispha;
- inherit (pkgs) lib;
- extraModules = {
- nixvim = {
- homeManagerModule = modules.nixVim.homeModules.nixvim;
- };
- agenix = modules.agenix.nixosModules.default;
- disko = modules.disko.nixosModules.default;
- serverphone = modules.serverphone.nixosModules.default;
- inherit (modules.home-manager.nixosModules) home-manager;
- inherit (modules.impermanence.nixosModules) impermanence;
- inherit (modules.lanzaboote.nixosModules) lanzaboote;
- };
- };
-in {
- inherit nixosConfigurations;
- checks."${system}" =
- nixLib.warnMerge {
- inherit
- (self.packages."${system}")
- nvim
- ;
- formatting = treefmtEval.config.build.check self;
- }
- tests "flake checks";
-
- # legacyPackages."${system}" = pkgs;
-
- packages."${system}" = import ./packages {
- inherit
- pkgs
- self
- ;
- myPkgs = packageSets.soispha;
- };
-
- formatter."${system}" = treefmtEval.config.build.wrapper;
-
- baseLib."${system}" = libraries.base;
-
- devShells."${system}" = {
- default = pkgs.mkShell {
- packages = [
- # secure boot
- pkgs.sbctl
-
- # other
- pkgs.cocogitto
- pkgs.git-bug
- pkgs.reuse
- pkgs.html2text
-
- # secrets
- pkgs.ragenix
- pkgs.rage
-
- # shell
- pkgs.shfmt
-
- # rust
- pkgs.rustfmt
- pkgs.cargo
-
- # nix
- pkgs.alejandra
- pkgs.deadnix
- pkgs.nvd
- ];
- };
- };
-}
diff --git a/flake/packages/default.nix b/flake/packages/default.nix
deleted file mode 100644
index 9c67eda3..00000000
--- a/flake/packages/default.nix
+++ /dev/null
@@ -1,97 +0,0 @@
-# nixos-config - My current NixOS configuration
-#
-# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de>
-# SPDX-License-Identifier: GPL-3.0-or-later
-#
-# This file is part of my nixos-config.
-#
-# You should have received a copy of the License along with this program.
-# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>.
-{
- pkgs,
- self,
- myPkgs,
- ...
-}: let
- inherit (pkgs) lib;
-
- run_test_description = pkgs.callPackage ../../tests/infrastructure/run.nix {};
-
- nvim =
- builtins.mapAttrs (
- name: value: let
- config = value.config.home-manager.users.soispha.programs.nixvim;
-
- # NOTE: This is copied from `nixvim`, and could be achieved by setting
- # `config.wrapRc` to `true`. But I have yet to find a way to set this in this
- # context, but not in the general context. <2024-11-09>
- # NOTE: I'm not sure why we need `nvimPackage` instead of just the `package`
- # attribute here, but the bare `package` attribute does not provide a `override`
- # function. <2025-02-02>
- wrapped = config.build.nvimPackage.override (prev: {
- wrapperArgs =
- (
- if lib.isString prev.wrapperArgs
- then prev.wrapperArgs
- else lib.escapeShellArgs prev.wrapperArgs
- )
- + " "
- + ''--add-flags -u --add-flags "${config.build.initFile}"'';
- wrapRc = false;
- });
- in
- wrapped
- )
- self.nixosConfigurations;
-
- output_neovim = lib.attrsets.mapAttrs' (name: value: lib.attrsets.nameValuePair "nvim_${name}" value) nvim;
-
- myPkgsFlat =
- builtins.listToAttrs
- # Filter out the `override` and `overrideDerivation` functions
- (builtins.filter ({
- name,
- value,
- }:
- lib.attrsets.isDerivation value) (lib.lists.flatten
- (
- lib.attrsets.mapAttrsToList (name: value:
- if lib.attrsets.isDerivation value
- then [
- {
- inherit name value;
- }
- ]
- else
- lib.attrsets.mapAttrsToList (name: value: {
- inherit name value;
- })
- value)
- myPkgs
- )));
-in
- {
- # install-iso = nixos-generators.nixosGenerate {
- # system = "x86_64-linux";
- # specialArgs = defaultSpecialArgs;
- # modules = [
- # ../../hosts/marduk
- # ];
- # format = "install-iso";
- # };
-
- # gpg-iso = nixos-generators.nixosGenerate {
- # system = "x86_64-linux";
- # specialArgs = defaultSpecialArgs;
- # modules =
- # [
- # ../../hosts/isimud
- # ]
- # ++ defaultModules;
- # format = "iso";
- # };
- nvim = nvim.tiamat;
- inherit run_test_description;
- }
- // output_neovim
- // myPkgsFlat
diff --git a/flake/treefmt.nix b/flake/treefmt.nix
deleted file mode 100644
index 703a85e8..00000000
--- a/flake/treefmt.nix
+++ /dev/null
@@ -1,95 +0,0 @@
-# nixos-config - My current NixOS configuration
-#
-# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de>
-# SPDX-License-Identifier: GPL-3.0-or-later
-#
-# This file is part of my nixos-config.
-#
-# You should have received a copy of the License along with this program.
-# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>.
-{
- treefmt-nix,
- pkgs,
-}:
-treefmt-nix.lib.evalModule pkgs (
- {pkgs, ...}: {
- # Used to find the project root
- projectRootFile = "flake.nix";
-
- programs = {
- alejandra.enable = true;
- rustfmt.enable = true;
- clang-format.enable = true;
- mdformat.enable = true;
- shfmt = {
- enable = true;
- indent_size = 4;
- };
- shellcheck.enable = true;
- prettier = {
- settings = {
- arrowParens = "always";
- bracketSameLine = false;
- bracketSpacing = true;
- editorconfig = true;
- embeddedLanguageFormatting = "auto";
- endOfLine = "lf";
- # experimentalTernaries = false;
- htmlWhitespaceSensitivity = "css";
- insertPragma = false;
- jsxSingleQuote = true;
- printWidth = 80;
- proseWrap = "always";
- quoteProps = "consistent";
- requirePragma = false;
- semi = true;
- singleAttributePerLine = true;
- singleQuote = true;
- trailingComma = "all";
- useTabs = false;
- vueIndentScriptAndStyle = false;
-
- tabWidth = 4;
- overrides = {
- files = ["*.js"];
- options.tabwidth = 2;
- };
- };
- };
- stylua = {
- enable = true;
- settings = {
- sort_requires.enabled = true;
- column_width = 120;
- line_endings = "Unix";
- indent_type = "Spaces";
- indent_width = 2;
- quote_style = "ForceDouble";
- call_parentheses = "Always";
- # space_after_function_names = "Never";
- collapse_simple_statement = "Always";
- };
- };
- ruff = {
- enable = true;
- format = true;
- };
- taplo.enable = true;
- };
-
- settings = {
- global.excludes = [
- "CHANGELOG.md"
- "NEWS.md"
- ];
- formatter = {
- clang-format = {
- options = ["--style" "GNU"];
- };
- shfmt = {
- includes = ["*.bash"];
- };
- };
- };
- }
-)