nixpkgs-fmt

This commit is contained in:
fleaz 2022-02-07 00:01:27 +01:00
parent 6a9a43478c
commit 04091588ee
10 changed files with 185 additions and 169 deletions

View file

@ -2,7 +2,8 @@
let
home-manager = (import ../nix/sources.nix).home-manager;
in {
in
{
imports = [
"${home-manager}/nixos"
];
@ -194,8 +195,10 @@ in {
bars = [{ command = "${pkgs.waybar}/bin/waybar"; }];
keybindings = let mod = "Mod4";
in {
keybindings =
let mod = "Mod4";
in
{
"${mod}+Return" = "exec foot";
"${mod}+p" = "exec ${pkgs.wofi}/bin/wofi --show drun";

View file

@ -3,8 +3,9 @@
# and in the NixOS manual (accessible by running nixos-help).
{ sources ? import ../../nix
, pkgs ? sources.pkgs {}
, ... } :
, pkgs ? sources.pkgs { }
, ...
}:
{
imports = [

View file

@ -25,11 +25,13 @@
fileSystems."/mnt/pool" = {
device = "//BART/Pool/";
fsType = "cifs";
options = let
options =
let
# this line prevents hanging on network split
automount_opts = "x-systemd.automount,noauto,x-systemd.idle-timeout=60,x-systemd.device-timeout=5s,x-systemd.mount-timeout=5s";
in ["${automount_opts},credentials=/etc/nixos/smb-secrets"];
in
[ "${automount_opts},credentials=/etc/nixos/smb-secrets" ];
};
swapDevices =

View file

@ -7,7 +7,8 @@
let
home-manager = (import ./nix/sources.nix).home-manager;
secretsFile = "/root.key";
in {
in
{
imports = [
# Include the results of the hardware scan.
./hardware-configuration.nix
@ -61,7 +62,7 @@ in {
enable = true;
ipv4 = true;
ipv6 = true;
};
};
hardware.opengl = {
enable = true;
@ -98,8 +99,11 @@ in {
# List packages installed in system profile. To search, run:
environment.systemPackages = with pkgs; [
vim wget curl git
];
vim
wget
curl
git
];
services.openssh.enable = true;
programs.ssh.startAgent = true;

View file

@ -5,7 +5,8 @@
{
imports =
[ (modulesPath + "/installer/scan/not-detected.nix")
[
(modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = [ "xhci_pci" "nvme" "usb_storage" "sd_mod" "rtsx_pci_sdmmc" ];
@ -14,14 +15,16 @@
boot.extraModulePackages = [ ];
fileSystems."/" =
{ device = "/dev/disk/by-uuid/b9edb32f-fb40-4d59-8abe-b187c88667d6";
{
device = "/dev/disk/by-uuid/b9edb32f-fb40-4d59-8abe-b187c88667d6";
fsType = "ext4";
};
boot.initrd.luks.devices."cryptroot".device = "/dev/disk/by-uuid/e2d53876-3fdc-486a-a354-ec834b256e43";
fileSystems."/boot/efi" =
{ device = "/dev/disk/by-uuid/502E-A0DC";
{
device = "/dev/disk/by-uuid/502E-A0DC";
fsType = "vfat";
};

View file

@ -1,4 +1,4 @@
{ ... }:{
{ ... }: {
services.openssh.enable = true;
programs.ssh.startAgent = true;
}

View file

@ -69,7 +69,7 @@ let
if builtins.hasAttr "nixpkgs" sources
then sourcesNixpkgs
else if hasNixpkgsPath && ! hasThisAsNixpkgsPath then
import <nixpkgs> {}
import <nixpkgs> { }
else
abort
''
@ -112,7 +112,7 @@ let
);
# https://github.com/NixOS/nixpkgs/blob/0258808f5744ca980b9a1f24fe0b1e6f0fecee9c/lib/lists.nix#L295
range = first: last: if first > last then [] else builtins.genList (n: first + n) (last - first + 1);
range = first: last: if first > last then [ ] else builtins.genList (n: first + n) (last - first + 1);
# https://github.com/NixOS/nixpkgs/blob/0258808f5744ca980b9a1f24fe0b1e6f0fecee9c/lib/strings.nix#L257
stringToCharacters = s: map (p: builtins.substring p 1 s) (range 0 (builtins.stringLength s - 1));
@ -123,7 +123,7 @@ let
concatStrings = builtins.concatStringsSep "";
# https://github.com/NixOS/nixpkgs/blob/8a9f58a375c401b96da862d969f66429def1d118/lib/attrsets.nix#L331
optionalAttrs = cond: as: if cond then as else {};
optionalAttrs = cond: as: if cond then as else { };
# fetchTarball version that is compatible between all the versions of Nix
builtins_fetchTarball = { url, name ? null, sha256 }@attrs:
@ -147,19 +147,22 @@ let
# Create the final "sources" from the config
mkSources = config:
mapAttrs (
mapAttrs
(
name: spec:
if builtins.hasAttr "outPath" spec
then abort
then
abort
"The values in sources.json should not have an 'outPath' attribute"
else
spec // { outPath = replace name (fetch config.pkgs name spec); }
) config.sources;
)
config.sources;
# The "config" used by the fetchers
mkConfig =
{ sourcesFile ? if builtins.pathExists ./sources.json then ./sources.json else null
, sources ? if isNull sourcesFile then {} else builtins.fromJSON (builtins.readFile sourcesFile)
, sources ? if isNull sourcesFile then { } else builtins.fromJSON (builtins.readFile sourcesFile)
, system ? builtins.currentSystem
, pkgs ? mkPkgs sources system
}: rec {
@ -171,4 +174,4 @@ let
};
in
mkSources (mkConfig {}) // { __functor = _: settings: mkSources (mkConfig settings); }
mkSources (mkConfig { }) // { __functor = _: settings: mkSources (mkConfig settings); }

View file

@ -9,5 +9,5 @@
../modules/ssh.nix
../users/fleaz.nix
];
}
}