From 0bad6fe50e9b41ab2b5641e020423275fe8de22c Mon Sep 17 00:00:00 2001 From: Gustav Bruhn Date: Tue, 18 Mar 2025 18:53:18 +0100 Subject: [PATCH] formatting --- flake.nix | 7 +++- hosts/framework/configuration.nix | 38 +++++++++--------- hosts/framework/hardware-configuration.nix | 46 ++++++++++++---------- hosts/framework/home.nix | 10 +++-- modules/home-manager/helix.nix | 5 +-- modules/nixos/cosmic.nix | 6 ++- modules/nixos/nixUpdate.nix | 15 +++++++ 7 files changed, 77 insertions(+), 50 deletions(-) create mode 100644 modules/nixos/nixUpdate.nix diff --git a/flake.nix b/flake.nix index a9275c1..225c724 100644 --- a/flake.nix +++ b/flake.nix @@ -12,7 +12,12 @@ }; }; - outputs = { self, nixpkgs, nixos-cosmic, ... }@inputs: { + outputs = { + self, + nixpkgs, + nixos-cosmic, + ... + } @ inputs: { # use "nixos", or your hostname as the name of the configuration # it's a better practice than "default" shown in the video nixosConfigurations.framework = nixpkgs.lib.nixosSystem { diff --git a/hosts/framework/configuration.nix b/hosts/framework/configuration.nix index fa78893..8e74377 100644 --- a/hosts/framework/configuration.nix +++ b/hosts/framework/configuration.nix @@ -1,16 +1,18 @@ # Edit this configuration file to define what should be installed on # your system. Help is available in the configuration.nix(5) man page # and in the NixOS manual (accessible by running ‘nixos-help’). - -{ config, pkgs, inputs, ... }: - { - imports = - [ # Include the results of the hardware scan. - ./hardware-configuration.nix - inputs.home-manager.nixosModules.default - ../../modules/nixos/cosmic.nix - ]; + config, + pkgs, + inputs, + ... +}: { + imports = [ + # Include the results of the hardware scan. + ./hardware-configuration.nix + inputs.home-manager.nixosModules.default + ../../modules/nixos/cosmic.nix + ]; # Bootloader. boot.loader.systemd-boot.enable = true; @@ -46,8 +48,6 @@ LC_TIME = "sv_SE.UTF-8"; }; - - # Configure keymap in X11 services.xserver.xkb = { layout = "se"; @@ -83,14 +83,14 @@ users.users.bruhng = { isNormalUser = true; description = "Gustav Bruhn"; - extraGroups = [ "networkmanager" "wheel" ]; + extraGroups = ["networkmanager" "wheel"]; packages = with pkgs; [ - # thunderbird + # thunderbird ]; }; home-manager = { - extraSpecialArgs = {inherit inputs; }; + extraSpecialArgs = {inherit inputs;}; users = { "bruhng" = import ./home.nix; }; @@ -105,10 +105,11 @@ # List packages installed in system profile. To search, run: # $ nix search wget environment.systemPackages = with pkgs; [ - nil - discord - # vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default. - # wget + nil + discord + alejandra + # vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default. + # wget ]; # Some programs need SUID wrappers, can be configured further or are @@ -137,5 +138,4 @@ # Before changing this value read the documentation for this option # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). system.stateVersion = "24.11"; # Did you read the comment? - } diff --git a/hosts/framework/hardware-configuration.nix b/hosts/framework/hardware-configuration.nix index 340115f..5ba707b 100644 --- a/hosts/framework/hardware-configuration.nix +++ b/hosts/framework/hardware-configuration.nix @@ -1,32 +1,36 @@ # Do not modify this file! It was generated by ‘nixos-generate-config’ # and may be overwritten by future invocations. Please make changes # to /etc/nixos/configuration.nix instead. -{ config, lib, pkgs, modulesPath, ... }: - { - imports = - [ (modulesPath + "/installer/scan/not-detected.nix") - ]; + config, + lib, + pkgs, + modulesPath, + ... +}: { + imports = [ + (modulesPath + "/installer/scan/not-detected.nix") + ]; - boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "thunderbolt" "usb_storage" "sd_mod" ]; - boot.initrd.kernelModules = [ ]; - boot.kernelModules = [ "kvm-amd" ]; - boot.extraModulePackages = [ ]; + boot.initrd.availableKernelModules = ["nvme" "xhci_pci" "thunderbolt" "usb_storage" "sd_mod"]; + boot.initrd.kernelModules = []; + boot.kernelModules = ["kvm-amd"]; + boot.extraModulePackages = []; - fileSystems."/" = - { device = "/dev/disk/by-uuid/a76b94ad-7f3e-430f-9b33-c5ba404f4761"; - fsType = "ext4"; - }; + fileSystems."/" = { + device = "/dev/disk/by-uuid/a76b94ad-7f3e-430f-9b33-c5ba404f4761"; + fsType = "ext4"; + }; - fileSystems."/boot" = - { device = "/dev/disk/by-uuid/1AA9-7C35"; - fsType = "vfat"; - options = [ "fmask=0077" "dmask=0077" ]; - }; + fileSystems."/boot" = { + device = "/dev/disk/by-uuid/1AA9-7C35"; + fsType = "vfat"; + options = ["fmask=0077" "dmask=0077"]; + }; - swapDevices = - [ { device = "/dev/disk/by-uuid/7c91c076-9dc5-4e75-b3f8-c81da8bda982"; } - ]; + swapDevices = [ + {device = "/dev/disk/by-uuid/7c91c076-9dc5-4e75-b3f8-c81da8bda982";} + ]; # Enables DHCP on each ethernet and wireless interface. In case of scripted networking # (the default) this is the recommended approach. When using systemd-networkd it's diff --git a/hosts/framework/home.nix b/hosts/framework/home.nix index 7bd0c55..bc9fa93 100644 --- a/hosts/framework/home.nix +++ b/hosts/framework/home.nix @@ -1,9 +1,11 @@ -{ config, pkgs, ... }: - -{ +{ + config, + pkgs, + ... +}: { imports = [ ../../modules/home-manager/helix.nix - ]; + ]; # Home Manager needs a bit of information about you and the paths it should # manage. home.username = "bruhng"; diff --git a/modules/home-manager/helix.nix b/modules/home-manager/helix.nix index b910a75..a005269 100644 --- a/modules/home-manager/helix.nix +++ b/modules/home-manager/helix.nix @@ -1,9 +1,8 @@ -{...}: -{ +{...}: { programs.helix = { enable = true; defaultEditor = true; - settings ={ + settings = { theme = "catppuccin_mocha"; editor = { line-number = "relative"; diff --git a/modules/nixos/cosmic.nix b/modules/nixos/cosmic.nix index 3af3708..8708e92 100644 --- a/modules/nixos/cosmic.nix +++ b/modules/nixos/cosmic.nix @@ -1,6 +1,8 @@ -{configs, pkgs, ...}: - { + configs, + pkgs, + ... +}: { services.desktopManager.cosmic.enable = true; services.displayManager.cosmic-greeter.enable = true; diff --git a/modules/nixos/nixUpdate.nix b/modules/nixos/nixUpdate.nix new file mode 100644 index 0000000..55018c6 --- /dev/null +++ b/modules/nixos/nixUpdate.nix @@ -0,0 +1,15 @@ +with import {}; + writeShellScriptBin "nixUpdate" '' + set -e + + + pushd ~/nixos/ + + # if git diff --quiet '*.nix'; then + # echo "no changes" + # popd + # exit 0 + # fi + + + ''