style: format nix files

This commit is contained in:
Felix Schröter 2020-09-23 13:19:19 +02:00
parent 22f6f8b323
commit 4d3bda09b9
No known key found for this signature in database
GPG key ID: 910ACB9F6BD26F58
19 changed files with 132 additions and 175 deletions

View file

@ -1,9 +1,5 @@
{ config, pkgs, ... }:
{
imports = [
./x11.nix
./gtk.nix
./gnome.nix
];
imports = [ ./x11.nix ./gtk.nix ./gnome.nix ];
}

View file

@ -19,16 +19,16 @@ let
# the gschema doesn't seem to be installed properly (see dconf)
makeFlags = [ "INSTALLBASE=$(out)/share/gnome-shell/extensions" ];
};
in
{
environment.systemPackages = with pkgs; with gnomeExtensions; [
gnome3.dconf-editor
gnome3.gnome-tweaks
gnome3.gnome-shell-extensions # required for user-theme
dash-to-panel
appindicator
pop-shell
];
in {
environment.systemPackages = with pkgs;
with gnomeExtensions; [
gnome3.dconf-editor
gnome3.gnome-tweaks
gnome3.gnome-shell-extensions # required for user-theme
dash-to-panel
appindicator
pop-shell
];
services.xserver.displayManager.gdm.enable = true;
services.xserver.displayManager.gdm.wayland = false;

View file

@ -1,38 +1,32 @@
{
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
inputs.home-manager = {
url = "github:nix-community/home-manager/master";
};
inputs.home-manager = { url = "github:nix-community/home-manager/master"; };
inputs.nur.url = "github:nix-community/NUR/master";
outputs = { self, nixpkgs, home-manager, nur }: let
systemModule = { hostName, hardwareConfig, config }: ({ pkgs, ... }: {
networking.hostName = hostName;
outputs = { self, nixpkgs, home-manager, nur }:
let
systemModule = { hostName, hardwareConfig, config }:
({ pkgs, ... }: {
networking.hostName = hostName;
# Let 'nixos-version --json' know about the Git revision
# of this flake.
system.configurationRevision = nixpkgs.lib.mkIf (self ? rev) self.rev;
# Let 'nixos-version --json' know about the Git revision
# of this flake.
system.configurationRevision = nixpkgs.lib.mkIf (self ? rev) self.rev;
nix.registry.nixpkgs.flake = nixpkgs;
nix.registry.nixpkgs.flake = nixpkgs;
nixpkgs.overlays = [
nur.overlay
];
nixpkgs.overlays = [ nur.overlay ];
imports = [
hardwareConfig
home-manager.nixosModules.home-manager
config
];
});
in {
imports =
[ hardwareConfig home-manager.nixosModules.home-manager config ];
});
in {
nixosConfigurations.felix-nixos = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules =
[
nixosConfigurations.felix-nixos = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
nixpkgs.nixosModules.notDetected
(systemModule {
hostName = "felix-nixos";
@ -40,12 +34,11 @@
config = ./home-pc.nix;
})
];
};
};
nixosConfigurations.pilot1 = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules =
[
nixosConfigurations.pilot1 = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
nixpkgs.nixosModules.notDetected
(systemModule {
hostName = "pilot1";
@ -53,9 +46,9 @@
config = ./work-pc.nix;
})
];
};
homeManagerModules.git = import ./home/modules/git.nix;
};
homeManagerModules.git = import ./home/modules/git.nix;
};
}

View file

@ -1,9 +1,7 @@
{ config, pkgs, ... }:
{
imports = [
./planck.nix
];
imports = [ ./planck.nix ];
boot.supportedFilesystems = [ "btrfs" ];
boot.kernelPackages = pkgs.linuxPackages_latest;
@ -16,9 +14,7 @@
# Bluetooth
hardware.bluetooth.enable = true;
hardware.bluetooth.config = {
General = {
Enable = "Source,Sink,Media,Socket";
};
General = { Enable = "Source,Sink,Media,Socket"; };
};
# Sound.

View file

@ -1,42 +1,44 @@
{ config, lib, pkgs, ... }:
{
boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" "sr_mod" ];
boot.initrd.availableKernelModules =
[ "nvme" "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" "sr_mod" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-amd" ];
boot.extraModulePackages = [ ];
fileSystems."/" =
{ device = "/dev/disk/by-uuid/9ef41d63-a7ad-406d-8c2b-5ad3fb4c0ea6";
fsType = "btrfs";
options = [ "subvol=@" "compress-force=zstd" "noatime" ];
};
fileSystems."/" = {
device = "/dev/disk/by-uuid/9ef41d63-a7ad-406d-8c2b-5ad3fb4c0ea6";
fsType = "btrfs";
options = [ "subvol=@" "compress-force=zstd" "noatime" ];
};
boot.initrd.luks.devices."enc".device = "/dev/disk/by-uuid/6f4f3ce1-57fd-4ec3-bb9d-7847853d2dcf";
boot.initrd.luks.devices."enc".device =
"/dev/disk/by-uuid/6f4f3ce1-57fd-4ec3-bb9d-7847853d2dcf";
fileSystems."/home" =
{ device = "/dev/disk/by-uuid/9ef41d63-a7ad-406d-8c2b-5ad3fb4c0ea6";
fsType = "btrfs";
options = [ "subvol=@home" "compress-force=zstd" "noatime" ];
};
fileSystems."/home" = {
device = "/dev/disk/by-uuid/9ef41d63-a7ad-406d-8c2b-5ad3fb4c0ea6";
fsType = "btrfs";
options = [ "subvol=@home" "compress-force=zstd" "noatime" ];
};
fileSystems."/swap" =
{ device = "/dev/disk/by-uuid/9ef41d63-a7ad-406d-8c2b-5ad3fb4c0ea6";
fsType = "btrfs";
options = [ "subvol=@swap" ];
neededForBoot = true;
};
fileSystems."/swap" = {
device = "/dev/disk/by-uuid/9ef41d63-a7ad-406d-8c2b-5ad3fb4c0ea6";
fsType = "btrfs";
options = [ "subvol=@swap" ];
neededForBoot = true;
};
fileSystems."/.snapshots" =
{ device = "/dev/disk/by-uuid/9ef41d63-a7ad-406d-8c2b-5ad3fb4c0ea6";
fsType = "btrfs";
options = [ "subvol=@snapshots" "compress-force=zstd" "noatime" ];
};
fileSystems."/.snapshots" = {
device = "/dev/disk/by-uuid/9ef41d63-a7ad-406d-8c2b-5ad3fb4c0ea6";
fsType = "btrfs";
options = [ "subvol=@snapshots" "compress-force=zstd" "noatime" ];
};
fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/5C20-4516";
fsType = "vfat";
};
fileSystems."/boot" = {
device = "/dev/disk/by-uuid/5C20-4516";
fsType = "vfat";
};
swapDevices = [ ];

View file

@ -6,10 +6,6 @@
hardware.opengl = {
driSupport32Bit = true;
extraPackages = with pkgs; [
vaapiIntel
vaapiVdpau
libvdpau-va-gl
];
extraPackages = with pkgs; [ vaapiIntel vaapiVdpau libvdpau-va-gl ];
};
}

View file

@ -9,9 +9,6 @@
hardware.opengl = {
driSupport32Bit = true;
extraPackages = with pkgs; [
libvdpau-va-gl
vaapiVdpau
];
extraPackages = with pkgs; [ libvdpau-va-gl vaapiVdpau ];
};
}

View file

@ -11,7 +11,7 @@
./services/jellyfin.nix
];
swapDevices = [ { device = "/swap/swapfile"; } ];
swapDevices = [{ device = "/swap/swapfile"; }];
nixpkgs.config.allowUnfree = true;

View file

@ -1,7 +1,6 @@
{ config, pkgs, ... }:
with pkgs;
{
with pkgs; {
imports = [
./shell
./editors
@ -20,9 +19,7 @@ with pkgs;
longitude = "10.4021562";
};
programs.ssh = {
enable = true;
};
programs.ssh = { enable = true; };
services.gpg-agent = {
enable = true;
@ -35,9 +32,7 @@ with pkgs;
programs.gpg.enable = true;
programs.git = {
defaultProfile = "work";
};
programs.git = { defaultProfile = "work"; };
xdg.configFile."nixpkgs/config.nix".text = ''
{

View file

@ -24,9 +24,7 @@
};
};
programs.ssh = {
enable = true;
};
programs.ssh = { enable = true; };
services.gpg-agent = {
enable = true;
@ -39,9 +37,7 @@
programs.gpg.enable = true;
programs.git = {
defaultProfile = "private";
};
programs.git = { defaultProfile = "private"; };
xdg.configFile."nixpkgs/config.nix".text = ''
{

View file

@ -1,38 +1,30 @@
{ config, pkgs, ... }:
{
imports = [
./modules/git.nix
];
imports = [ ./modules/git.nix ];
programs.git = {
enable = true;
profiles = {
private = {
name = "Felix Tenley";
email = "dev@felschr.com";
name = "Felix Tenley";
email = "dev@felschr.com";
signingKey = "6AB3 7A28 5420 9A41 82D9 0068 910A CB9F 6BD2 6F58";
dirs = [ "~/dev/private/" "/etc/nixos" ];
dirs = [ "~/dev/private/" "/etc/nixos" ];
};
work = {
name = "Felix Schröter";
email = "fs@upsquared.com";
name = "Felix Schröter";
email = "fs@upsquared.com";
signingKey = "F28B FB74 4421 7580 5A49 2930 BE85 F0D9 987F A014";
dirs = [ "~/dev/work/" ];
dirs = [ "~/dev/work/" ];
};
};
ignores = [".direnv"];
signing = {
signByDefault = true;
};
ignores = [ ".direnv" ];
signing = { signByDefault = true; };
extraConfig = {
init = {
defaultBranch = "main";
};
pull = {
rebase = true;
};
init = { defaultBranch = "main"; };
pull = { rebase = true; };
rebase = {
autoStash = true;
autoSquash = true;
@ -41,8 +33,10 @@
};
};
aliases = {
mr = "!sh -c 'git fetch $1 merge-requests/$2/head:mr-$1-$2 && git checkout mr-$1-$2' -";
pr = "!sh -c 'git fetch $1 refs/pull/$2/head:pr/$1 && git checkout pr/$2'";
mr =
"!sh -c 'git fetch $1 merge-requests/$2/head:mr-$1-$2 && git checkout mr-$1-$2' -";
pr =
"!sh -c 'git fetch $1 refs/pull/$2/head:pr/$1 && git checkout pr/$2'";
};
};
}

View file

@ -7,7 +7,7 @@
home.packages = [ pkgs.keybase-gui ];
xdg.configFile."autostart/keybase.desktop".text = with pkgs;
builtins.replaceStrings
["${keybase-gui}"] ["env KEYBASE_AUTOSTART=1 ${keybase-gui}"]
(builtins.readFile "${keybase-gui}/share/applications/keybase.desktop");
builtins.replaceStrings [ "${keybase-gui}" ]
[ "env KEYBASE_AUTOSTART=1 ${keybase-gui}" ]
(builtins.readFile "${keybase-gui}/share/applications/keybase.desktop");
}

View file

@ -1,8 +1,5 @@
{ config, pkgs, ... }:
with pkgs;
{
home.packages = [
wally-cli
];
with pkgs; {
home.packages = [ wally-cli ];
}

View file

@ -2,23 +2,21 @@
with pkgs;
let
signal-desktop = runCommand "signal-desktop" {
buildInputs = [ makeWrapper ];
} ''
mkdir $out
ln -s ${pkgs.signal-desktop}/* $out
rm $out/bin
makeWrapper ${pkgs.signal-desktop}/bin/signal-desktop $out/bin/signal-desktop \
--add-flags "--use-tray-icon"
'';
in
{
signal-desktop =
runCommand "signal-desktop" { buildInputs = [ makeWrapper ]; } ''
mkdir $out
ln -s ${pkgs.signal-desktop}/* $out
rm $out/bin
makeWrapper ${pkgs.signal-desktop}/bin/signal-desktop $out/bin/signal-desktop \
--add-flags "--use-tray-icon"
'';
in {
home.packages = [ signal-desktop ];
# TODO switch to overwritten `signal-desktop` when
# desktop file is updated with correct exec path
xdg.configFile."autostart/signal-desktop.desktop".text =
builtins.replaceStrings
["bin/signal-desktop"] ["bin/signal-desktop --start-in-tray"]
(builtins.readFile "${pkgs.signal-desktop}/share/applications/signal-desktop.desktop");
builtins.replaceStrings [ "bin/signal-desktop" ]
[ "bin/signal-desktop --start-in-tray" ] (builtins.readFile
"${pkgs.signal-desktop}/share/applications/signal-desktop.desktop");
}

View file

@ -1,10 +1,7 @@
{ config, pkgs, ... }:
with pkgs;
{
home.packages = with pkgs; [
mullvad-vpn
];
with pkgs; {
home.packages = with pkgs; [ mullvad-vpn ];
# autostart
xdg.configFile."autostart/mullvad-vpn.desktop".source =

View file

@ -1,18 +1,9 @@
{ config, pkgs, ... }:
{
imports = [
./hardened.nix
./i18n.nix
./nix.nix
./vpn.nix
];
imports = [ ./hardened.nix ./i18n.nix ./nix.nix ./vpn.nix ];
environment.systemPackages = with pkgs; [
wget
curl
neovim
];
environment.systemPackages = with pkgs; [ wget curl neovim ];
fonts.fonts = with pkgs; [
fira-code

View file

@ -2,8 +2,7 @@
# utilises some of the measures from
# <nixpkgs/nixos/modules/profiles/hardened.nix>
with lib;
{
with lib; {
boot.loader.systemd-boot.editor = mkDefault false;
nix.allowedUsers = mkDefault [ "@users" ];

View file

@ -2,15 +2,27 @@
with pkgs;
let
dotnet-combined = with dotnetCorePackages; combinePackages [ sdk_3_1 sdk_2_1 ];
# preview
# buildDotnet = attrs: callPackage (import <nixpkgs/pkgs/development/compilers/dotnet/build-dotnet.nix> attrs) {};
# buildAspNetCore = attrs: buildDotnet (attrs // { type = "aspnetcore"; });
# buildNetCore = attrs: buildDotnet (attrs // { type = "netcore"; });
# buildNetCoreSdk = attrs: buildDotnet (attrs // { type = "sdk"; });
# sdk_5_0_rc_1 = buildNetCoreSdk {
# version = "5.0.100-rc.1.20452.10";
# sha512 = {
# x86_64-linux = "d7e709dacc4bb188c2380060d24bfb5b791240dc33af8499fb4a31e1885a9377dad1d1ebc76847432ea67d5e4ac832a31679dc293e09fa6dade28f5fbbe4db9b";
# aarch64-linux = "2d04890c71e845d1eb08f5dfbbb9c93024d7a52fb1cc3fd50bd51bc6bd44e455c5c82abc8f04eef23bd012984ae5f86143c600ceb49c4c733935d95d5b68785f";
# x86_64-darwin = "06bb40273071f3dd1e84ebf58abc7798795d5f1ac298f24bf7109d1597fd52ff31bcbf2b81f86d91d37ae293678d07f8da0469d7cbd318d19a8d718b6629dcac";
# };
# };
dotnet-combined = with dotnetCorePackages; combinePackages [ sdk_3_1 ];
dotnetRoot = "${dotnet-combined}";
dotnetSdk = "${dotnet-combined}/sdk";
dotnetBinary = "${dotnetRoot}/bin/dotnet";
in
{
home.packages = [
dotnet-combined
];
in {
home.packages = [ dotnet-combined ];
home.sessionVariables = {
DOTNET_ROOT = dotnetRoot;

View file

@ -1,9 +1,7 @@
{ config, pkgs, ... }:
{
environment.systemPackages = with pkgs; [
docker-compose
];
environment.systemPackages = with pkgs; [ docker-compose ];
virtualisation.docker = {
enable = true;