format with nixpkgs-fmt

This commit is contained in:
zimbatm 2021-01-03 00:07:49 +01:00
parent 2ca351fdac
commit be65264a3f
No known key found for this signature in database
GPG key ID: 71BAF6D40C1D63D7
20 changed files with 203 additions and 213 deletions

View file

@ -1,7 +1,5 @@
{ config, pkgs, ... }:
let
postBuildHook = pkgs.writeScript "post-build-hook.sh" ''
#!${pkgs.runtimeShell}
export PATH=$PATH:${pkgs.nix}/bin
@ -16,7 +14,8 @@ let
sources = import ../nix/sources.nix;
in {
in
{
nixpkgs.overlays = [
(self: super: {

View file

@ -1,5 +1,4 @@
{ config, pkgs, lib, ... }:
let
userImports =
let

View file

@ -1,5 +1,4 @@
{ pkgs, ... }:
let
gitlabModule = builtins.fetchTarball {
url = "https://gitlab.com/arianvp/nixos-gitlab-runner/-/archive/9126927c701aa399bd1734e7e5230c3a0010c1b7/nixos-gitlab-runner-9126927c701aa399bd1734e7e5230c3a0010c1b7.tar.gz";

View file

@ -8,7 +8,7 @@
boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "sd_mod" ];
boot.kernelModules = [ "kvm-amd" ];
boot.extraModulePackages = [];
boot.extraModulePackages = [ ];
fileSystems."/" =
{
@ -34,7 +34,7 @@
fsType = "ext4";
};
swapDevices = [];
swapDevices = [ ];
nix.maxJobs = lib.mkDefault 16;
}

View file

@ -1,7 +1,6 @@
{ lib, pkgs, config, ... }:
with lib;
let
cfg = config;
@ -20,7 +19,8 @@ let
'';
};
in {
in
{
options.services.hydra = {
adminPasswordFile = mkOption {
type = types.str;
@ -29,7 +29,7 @@ in {
declarativeProjects = mkOption {
description = "Declarative projects";
default = {};
default = { };
type = with types; attrsOf (submodule {
options = {
inputValue = mkOption {
@ -82,7 +82,7 @@ in {
forceSSL = true;
enableACME = true;
locations."/" = {
proxyPass = "http://localhost:${toString(hydraPort)}";
proxyPass = "http://localhost:${toString (hydraPort)}";
extraConfig = ''
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
@ -124,7 +124,8 @@ in {
systems = [ "x86_64-linux" "builtin" ];
maxJobs = 8;
supportedFeatures = [ "nixos-test" "big-parallel" "kvm" ];
}];
}
];
};
# Create a admin user and configure a declarative project
@ -134,7 +135,7 @@ in {
TimeoutStartSec = "60";
};
wantedBy = [ "multi-user.target" ];
after = ["hydra-server.service" ];
after = [ "hydra-server.service" ];
requires = [ "hydra-server.service" ];
environment = {
inherit (cfg.systemd.services.hydra-init.environment) HYDRA_DBI;
@ -151,7 +152,8 @@ in {
export URL=http://localhost:${toString hydraPort}
'' +
(concatStringsSep "\n" (mapAttrsToList (n: v: ''
(concatStringsSep "\n" (mapAttrsToList
(n: v: ''
export DECL_PROJECT_NAME="${n}"
export DECL_DISPLAY_NAME="${v.displayName}"
export DECL_VALUE="${v.inputValue}"
@ -160,8 +162,8 @@ in {
export DECL_DESCRIPTION="${v.description}"
export DECL_HOMEPAGE="${v.homepage}"
${createDeclarativeProjectScript}/bin/create-declarative-project
'') cfg.services.hydra.declarativeProjects));
'')
cfg.services.hydra.declarativeProjects));
};
};
}

View file

@ -3,7 +3,7 @@ let
userLib = import ../users/lib.nix { inherit lib; };
sources = import ../nix/sources.nix;
marvinNixpkgs = (import (sources.marvin-mk2.outPath + "/definitions.nix") {}).pkgs;
marvinNixpkgs = (import (sources.marvin-mk2.outPath + "/definitions.nix") { }).pkgs;
marvin-mk2 = marvinNixpkgs.python3.pkgs.buildPythonApplication rec {
pname = "marvin-mk2";

View file

@ -2,5 +2,5 @@
services.matterbridge.enable = true;
services.matterbridge.configPath = "/run/keys/matterbridge.toml";
# Allow to access /run/keys
users.users.matterbridge.extraGroups = ["keys"];
users.users.matterbridge.extraGroups = [ "keys" ];
}

View file

@ -1,5 +1,4 @@
{ pkgs, lib, config, ... }:
let
userLib = import ../users/lib.nix { inherit lib; };
@ -20,7 +19,7 @@ let
in
{
users.groups.r-ryantm = {};
users.groups.r-ryantm = { };
users.users.r-ryantm = {
useDefaultShell = true;
isNormalUser = true; # The hub cli seems to really want stuff to be set up like a normal user

View file

@ -1,5 +1,4 @@
with builtins;
let
secrets = import ./secrets.nix;

View file

@ -4,8 +4,8 @@ let
pkgs = import sources.nixpkgs {
inherit system;
config = {};
config = { };
overlays = import ./overlays.nix;
};
in
pkgs
pkgs

View file

@ -7,7 +7,7 @@ let
;
terraform-provider-vpsadmin =
pkgs.callPackage ./terraform-provider-vpsadmin.nix {};
pkgs.callPackage ./terraform-provider-vpsadmin.nix { };
terraform = pkgs.terraform.withPlugins (
p: [
@ -20,10 +20,9 @@ let
};
in
[
[
(self: super: { sources = import ./sources.nix; })
(self: super: {
nix-community-infra = nix-community-infra super;
})
]
]

View file

@ -1,7 +1,5 @@
# This file has been generated by Niv.
let
#
# The fetchers. fetch_<type> fetches specs of type <type>.
#
@ -32,7 +30,7 @@ let
if spec ? tag then "refs/tags/${spec.tag}" else
abort "In git source '${name}': Please specify `ref`, `tag` or `branch`!";
in
builtins.fetchGit { url = spec.repo; inherit (spec) rev; inherit ref; };
builtins.fetchGit { url = spec.repo; inherit (spec) rev;inherit ref; };
fetch_local = spec: spec.path;
@ -69,7 +67,7 @@ let
if builtins.hasAttr "nixpkgs" sources
then sourcesNixpkgs
else if hasNixpkgsPath && ! hasThisAsNixpkgsPath then
import <nixpkgs> {}
import <nixpkgs> { }
else
abort
''
@ -109,7 +107,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));
@ -120,7 +118,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:
@ -144,19 +142,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 {
@ -168,4 +169,4 @@ let
};
in
mkSources (mkConfig {}) // { __functor = _: settings: mkSources (mkConfig settings); }
mkSources (mkConfig { }) // { __functor = _: settings: mkSources (mkConfig settings); }

View file

@ -1,5 +1,4 @@
{ config, pkgs, lib, ... }:
let
userLib = import ./lib.nix { inherit lib; };
keys = [

View file

@ -1,5 +1,4 @@
{ config, pkgs, lib, ... }:
let
userLib = import ./lib.nix { inherit lib; };
keys = [

View file

@ -1,5 +1,4 @@
{ config, pkgs, lib, ... }:
let
userLib = import ./lib.nix { inherit lib; };
keys = [

View file

@ -1,5 +1,4 @@
{ config, pkgs, lib, ... }:
let
userLib = import ./lib.nix { inherit lib; };
keys = [

View file

@ -1,5 +1,4 @@
{ config, pkgs, lib, ... }:
let
userLib = import ./lib.nix { inherit lib; };
keys = [

View file

@ -1,5 +1,4 @@
{ config, pkgs, lib, ... }:
let
userLib = import ./lib.nix { inherit lib; };
keys = [

View file

@ -1,5 +1,4 @@
{ config, pkgs, lib, ... }:
let
userLib = import ./lib.nix { inherit lib; };
keys = [