started reformatting and added formatter

This commit is contained in:
Jakub Kropáček 2024-09-19 17:44:40 +02:00
parent 77e9e90c6d
commit c6e3daefbf
10 changed files with 243 additions and 164 deletions

View file

@ -13,7 +13,9 @@
}; };
}; };
outputs = inputs@{ self, nixpkgs, ... }: { outputs =
inputs@{ self, nixpkgs, ... }:
{
# Please replace my-nixos with your hostname # Please replace my-nixos with your hostname
nixosConfigurations = { nixosConfigurations = {
work-ntb = nixpkgs.lib.nixosSystem { work-ntb = nixpkgs.lib.nixosSystem {
@ -32,5 +34,6 @@
inherit inputs; inherit inputs;
}; };
}; };
formatter.x86_64-linux = nixpkgs.legacyPackages.x86_64-linux.nixfmt-rfc-style;
}; };
} }

View file

@ -2,11 +2,16 @@
# your system. Help is available in the configuration.nix(5) man page # your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running nixos-help). # and in the NixOS manual (accessible by running nixos-help).
{ config, pkgs, hostname, ... }: {
config,
pkgs,
hostname,
...
}:
{ {
imports = imports = [
[ # Include the results of the hardware scan. # Include the results of the hardware scan.
../${hostname}/hardware-configuration.nix ../${hostname}/hardware-configuration.nix
]; ];
@ -95,17 +100,21 @@
users.users.krop = { users.users.krop = {
isNormalUser = true; isNormalUser = true;
description = "Jakub Kropacek"; description = "Jakub Kropacek";
extraGroups = [ "networkmanager" "wheel" ]; extraGroups = [
"networkmanager"
"wheel"
];
shell = pkgs.zsh; shell = pkgs.zsh;
}; };
# Allow unfree packages # Allow unfree packages
nixpkgs.config.allowUnfree = true; nixpkgs.config.allowUnfree = true;
# Enable flakes # Enable flakes
nix.settings.experimental-features = [ "nix-command" "flakes" ]; nix.settings.experimental-features = [
"nix-command"
"flakes"
];
# List packages installed in system profile. To search, run: # List packages installed in system profile. To search, run:
# $ nix search wget # $ nix search wget
@ -126,7 +135,6 @@
gnomeExtensions.grand-theft-focus gnomeExtensions.grand-theft-focus
]; ];
programs = { programs = {
tmux.enable = true; tmux.enable = true;
zsh.enable = true; zsh.enable = true;
@ -141,8 +149,14 @@
services.flatpak = { services.flatpak = {
enable = true; enable = true;
remotes = [ remotes = [
{ name = "flathub"; location = "https://dl.flathub.org/repo/flathub.flatpakrepo"; } {
{ name = "flathub-beta"; location = "https://flathub.org/beta-repo/flathub-beta.flatpakrepo"; } name = "flathub";
location = "https://dl.flathub.org/repo/flathub.flatpakrepo";
}
{
name = "flathub-beta";
location = "https://flathub.org/beta-repo/flathub-beta.flatpakrepo";
}
]; ];
packages = [ packages = [
"org.gnome.World.PikaBackup" "org.gnome.World.PikaBackup"

View file

@ -1,6 +1,15 @@
{config, pkgs, inputs, ...}: { {
config,
pkgs,
inputs,
...
}:
{
imports = [ imports = [
(import ../base {inherit config pkgs; hostname = "work-ntb"; }) (import ../base {
inherit config pkgs;
hostname = "work-ntb";
})
]; ];
# My own modules configuration # My own modules configuration
@ -13,7 +22,9 @@
}; };
home-manager = { home-manager = {
extraSpecialArgs = { inherit inputs; }; extraSpecialArgs = {
inherit inputs;
};
users = { users = {
"krop" = import ./home.nix; "krop" = import ./home.nix;
}; };

View file

@ -1,27 +1,42 @@
# Do not modify this file! It was generated by nixos-generate-config # Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes # and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead. # to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }: {
config,
lib,
pkgs,
modulesPath,
...
}:
{ {
imports = imports = [
[ (modulesPath + "/installer/scan/not-detected.nix") (modulesPath + "/installer/scan/not-detected.nix")
]; ];
boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "usb_storage" "sd_mod" "rtsx_pci_sdmmc" ]; boot.initrd.availableKernelModules = [
"xhci_pci"
"ahci"
"usb_storage"
"sd_mod"
"rtsx_pci_sdmmc"
];
boot.initrd.kernelModules = [ ]; boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ]; boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ]; boot.extraModulePackages = [ ];
fileSystems."/" = fileSystems."/" = {
{ device = "/dev/disk/by-uuid/360cfb7a-07d9-445b-83e2-6ef19bd55948"; device = "/dev/disk/by-uuid/360cfb7a-07d9-445b-83e2-6ef19bd55948";
fsType = "ext4"; fsType = "ext4";
}; };
fileSystems."/boot" = fileSystems."/boot" = {
{ device = "/dev/disk/by-uuid/5F8E-3C09"; device = "/dev/disk/by-uuid/5F8E-3C09";
fsType = "vfat"; fsType = "vfat";
options = [ "fmask=0077" "dmask=0077" ]; options = [
"fmask=0077"
"dmask=0077"
];
}; };
swapDevices = [ ]; swapDevices = [ ];

View file

@ -100,17 +100,20 @@
style.name = "adwaita-dark"; style.name = "adwaita-dark";
}; };
programs.git = { programs.git = {
enable = true; enable = true;
userName = "Jakub Kropáček"; userName = "Jakub Kropáček";
userEmail = "kropikuba@gmail.com"; userEmail = "kropikuba@gmail.com";
includes = let workcfg = { includes =
let
workcfg = {
user = { user = {
email = "jakub.kropacek@olc.cz"; email = "jakub.kropacek@olc.cz";
name = "Jakub Kropáček"; name = "Jakub Kropáček";
}; };
}; in [ };
in
[
{ {
condition = "gitdir:~/Repositories/OLC/**"; condition = "gitdir:~/Repositories/OLC/**";
contents = workcfg; contents = workcfg;

View file

@ -1,7 +1,13 @@
{ config, pkgs, lib, ... }@inputs: {
config,
pkgs,
lib,
...
}@inputs:
let let
cfg = config.krop.devtools; cfg = config.krop.devtools;
in { in
{
imports = [ imports = [
./python.nix ./python.nix
./ide.nix ./ide.nix
@ -15,7 +21,8 @@ in {
}; };
}; };
config = let config =
let
tools = with pkgs; [ tools = with pkgs; [
lazygit lazygit
lazydocker lazydocker
@ -23,7 +30,8 @@ in {
albert albert
openssl_3_3 openssl_3_3
]; ];
in { in
{
environment.systemPackages = tools; environment.systemPackages = tools;
}; };
} }

View file

@ -0,0 +1,4 @@
{
...
}:
{ }

View file

@ -1,23 +1,32 @@
{ config, pkgs, lib, ... }: {
config,
pkgs,
lib,
...
}:
let let
cfg = config.krop.ide; cfg = config.krop.ide;
in { in
{
options.krop.ide = { options.krop.ide = {
enable = lib.mkOption { enable = lib.mkOption {
type = lib.types.bool; type = lib.types.bool;
default = lib.mkOptionDefault true; default = true;
example = true; example = true;
}; };
install-pycharm = lib.mkOption { install-pycharm = lib.mkOption {
type = lib.types.bool; type = lib.types.bool;
default = lib.mkOptionDefault false; default = false;
example = true; example = true;
}; };
}; };
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
environment.systemPackages = with pkgs; [ environment.systemPackages =
with pkgs;
[
zed-editor zed-editor
vscodium vscodium
] ++ lib.optionals cfg.install-pycharm [pkgs.jetbrains.pycharm-professional]; ]
++ lib.optionals cfg.install-pycharm [ pkgs.jetbrains.pycharm-professional ];
}; };
} }

View file

@ -1,24 +1,36 @@
{ config, pkgs, lib, ... }: {
config,
pkgs,
lib,
...
}:
let let
cfg = config.krop.python; cfg = config.krop.python;
in { in
{
options.krop.python = { options.krop.python = {
enable = lib.mkOption { enable = lib.mkOption {
type = lib.types.bool; type = lib.types.bool;
default = lib.mkOptionDefault false; default = false;
example = true; example = true;
}; };
install-older = lib.mkOption { install-older = lib.mkOption {
type = lib.types.bool; type = lib.types.bool;
default = lib.mkOptionDefault true; default = true;
example = true; example = true;
}; };
}; };
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
environment.systemPackages = with pkgs; [ environment.systemPackages =
with pkgs;
[
python3 python3
poetry poetry
] ++ lib.optionals cfg.install-older [python311 python310]; ]
++ lib.optionals cfg.install-older [
python311
python310
];
}; };
} }