Compare commits

...

6 Commits

11 changed files with 54 additions and 44 deletions

View File

@@ -1,2 +1,3 @@
# nix fmt
# nix fmt & statix
f011c8d71ba09bd94ab04b8d771858b90a03fbf9
3aff25b4486a143cd6282f8845c16216598e1c7e

View File

@@ -4,3 +4,11 @@ repos:
hooks:
- id: nixfmt-nix
args: [--, --check]
- repo: local
hooks:
- id: statix
name: statix
entry: statix check
language: system
files: \.nix$
pass_filenames: false

View File

@@ -50,15 +50,19 @@
}:
let
my-lib = import ./lib { lib = nixpkgs.lib; };
my-lib = import ./lib { inherit (nixpkgs) lib; };
overlays = [
(_: prev: {
claude-code =
(import inputs.nixpkgs-unstable {
system = prev.stdenv.hostPlatform.system;
config.allowUnfree = true;
}).claude-code;
inherit
(
(import inputs.nixpkgs-unstable {
inherit (prev.stdenv.hostPlatform) system;
config.allowUnfree = true;
})
)
claude-code
;
})
];
@@ -94,7 +98,7 @@
nixosModules = import ./modules/nixos {
inherit my-lib;
lib = nixpkgs.lib;
inherit (nixpkgs) lib;
} { };
}
// flake-utils.lib.eachDefaultSystem (
@@ -103,15 +107,25 @@
pkgs = nixpkgs.legacyPackages.${system};
in
{
packages = import ./packages {
inherit my-lib;
lib = nixpkgs.lib;
} (inputs // { inherit system; });
packages =
import ./packages
{
inherit my-lib;
inherit (nixpkgs) lib;
}
{
pkgs = nixpkgs.legacyPackages.${system};
pkgs-unstable = inputs.nixpkgs-unstable.legacyPackages.${system};
pkgs-master = inputs.nixpkgs-master.legacyPackages.${system};
};
formatter = pkgs.nixfmt-tree;
devShells.default = pkgs.mkShell {
packages = [ pkgs.pre-commit ];
packages = [
pkgs.pre-commit
pkgs.statix
];
};
}
);

View File

@@ -7,8 +7,6 @@ let
# TODO:(@janezicmatej) restructure keys import
keys = import ../../users/matej/keys.nix;
cfg = config.initrd-ssh;
# generate host keys for new machines: ./scripts/initrd-ssh-keygen.sh
keyDir = "/etc/secrets/initrd";
@@ -63,10 +61,10 @@ in
};
};
config = lib.mkIf cfg.enable {
boot.initrd.kernelModules = [ cfg.networkModule ];
boot.kernelParams = lib.mkIf cfg.ip.enable [
"ip=${mkIpString cfg.ip}"
config = lib.mkIf config.initrd-ssh.enable {
boot.initrd.kernelModules = [ config.initrd-ssh.networkModule ];
boot.kernelParams = lib.mkIf config.initrd-ssh.ip.enable [
"ip=${mkIpString config.initrd-ssh.ip}"
];
boot.initrd.network = {
@@ -78,7 +76,7 @@ in
"${keyDir}/ssh_host_rsa_key"
"${keyDir}/ssh_host_ed25519_key"
];
authorizedKeys = cfg.authorizedKeys;
inherit (config.initrd-ssh) authorizedKeys;
};
postCommands = ''
echo 'cryptsetup-askpass' >> /root/.profile

View File

@@ -4,9 +4,6 @@
pkgs,
...
}:
let
cfg = config.tuigreet;
in
{
options = {
tuigreet = {
@@ -18,18 +15,16 @@ in
};
};
config = lib.mkIf cfg.enable {
config = lib.mkIf config.tuigreet.enable {
services.greetd = {
enable = true;
useTextGreeter = true;
settings = {
default_session = {
command = builtins.toString (
pkgs.writeShellScript "tuigreet-session" ''
${pkgs.util-linux}/bin/setterm --blank 1 --powersave powerdown --powerdown 1
exec ${pkgs.tuigreet}/bin/tuigreet --time --remember --cmd ${cfg.command}
''
);
command = pkgs.writeShellScript "tuigreet-session" ''
${pkgs.util-linux}/bin/setterm --blank 1 --powersave powerdown --powerdown 1
exec ${pkgs.tuigreet}/bin/tuigreet --time --remember --cmd ${config.tuigreet.command}
'';
user = "greeter";
};
};

View File

@@ -4,9 +4,6 @@
pkgs,
...
}:
let
cfg = config.workstation;
in
{
options = {
workstation = {
@@ -14,7 +11,7 @@ in
};
};
config = lib.mkIf cfg.enable {
config = lib.mkIf config.workstation.enable {
virtualisation.docker = {
enable = true;
logDriver = "json-file";

View File

@@ -1,7 +1,6 @@
{ nixpkgs, system, ... }:
{ pkgs, ... }:
let
pkgs = import nixpkgs { inherit system; };
version = "v0.3.2";
in
pkgs.rustPlatform.buildRustPackage {

View File

@@ -1,13 +1,12 @@
{ nixpkgs, system, ... }:
{ pkgs, ... }:
let
pkgs = import nixpkgs { inherit system; };
version = "C6r62em";
in
pkgs.stdenv.mkDerivation {
pname = "ca-matheo-si";
version = version;
inherit version;
src = pkgs.fetchurl {
url = "http://ipa2.matheo.si/ipa/config/ca.crt";

View File

@@ -1,8 +1,7 @@
{ nixpkgs-master, system, ... }:
{ pkgs-master, ... }:
let
nixpkgs = nixpkgs-master;
pkgs = import nixpkgs { inherit system; };
pkgs = pkgs-master;
version = "e24855c";
in
pkgs.buildGoModule.override

View File

@@ -1,7 +1,6 @@
{ nixpkgs, system, ... }:
{ pkgs, ... }:
let
pkgs = import nixpkgs { inherit system; };
version = "main";
in
pkgs.stdenv.mkDerivation {

1
statix.toml Normal file
View File

@@ -0,0 +1 @@
disabled = ["repeated_keys"]