add statix check

This commit is contained in:
Cyryl Płotnicki 2022-05-02 09:59:47 +01:00
parent 91ca724dea
commit 40dbc75827
16 changed files with 32 additions and 36 deletions

View file

@ -8,7 +8,8 @@ secrets:
tasks: tasks:
- check: | - check: |
cd dotfiles cd dotfiles
nix-shell --pure --run 'nix-experimental flake info' nix-shell --pure --run 'nix --extra-experimental-features "flakes nix-command" flake info'
nix-shell --pure --run 'statix check'
- github_push: | - github_push: |
set +xv set +xv

View file

@ -7,7 +7,7 @@
let let
mkServer = pkgs: system: hostname: mkServer = pkgs: system: hostname:
pkgs.lib.nixosSystem { pkgs.lib.nixosSystem {
system = system; inherit system;
modules = [ modules = [
(./. + "/nixos/boxes/${hostname}") (./. + "/nixos/boxes/${hostname}")
agenix.nixosModules.age agenix.nixosModules.age
@ -23,7 +23,7 @@
}; };
mkWorkstation = pkgs: system: hostname: mkWorkstation = pkgs: system: hostname:
pkgs.lib.nixosSystem { pkgs.lib.nixosSystem {
system = system; inherit system;
modules = [ modules = [
(./. + "/nixos/boxes/${hostname}") (./. + "/nixos/boxes/${hostname}")
(import ./nixos/email-accounts.nix) (import ./nixos/email-accounts.nix)
@ -56,6 +56,7 @@
with nixpkgs-nixos-unstable.legacyPackages."x86_64-linux"; [ with nixpkgs-nixos-unstable.legacyPackages."x86_64-linux"; [
cacert cacert
git git
nixFlakes
nixpkgs-fmt nixpkgs-fmt
openssh openssh
openssl openssl

View file

@ -1,7 +1,6 @@
{ config, pkgs, inputs, lib, ... }: { config, pkgs, inputs, lib, ... }:
let let
tailscale = inherit (inputs.nixpkgs-nixos-unstable.legacyPackages."x86_64-linux") tailscale;
inputs.nixpkgs-nixos-unstable.legacyPackages."x86_64-linux".tailscale;
in { in {
systemd.services.tailscale-autoconnect = { systemd.services.tailscale-autoconnect = {
description = "Automatic connection to Tailscale"; description = "Automatic connection to Tailscale";

View file

@ -1,7 +1,6 @@
{ config, pkgs, inputs, lib, ... }: { config, pkgs, inputs, lib, ... }:
let let
tailscale = inherit (inputs.nixpkgs-nixos-unstable.legacyPackages."x86_64-linux") tailscale;
inputs.nixpkgs-nixos-unstable.legacyPackages."x86_64-linux".tailscale;
in { in {
systemd.services.tailscale-autoconnect = { systemd.services.tailscale-autoconnect = {
description = "Automatic connection to Tailscale"; description = "Automatic connection to Tailscale";

View file

@ -1,7 +1,6 @@
{ config, pkgs, inputs, lib, ... }: { config, pkgs, inputs, lib, ... }:
let let
tailscale = inherit (inputs.nixpkgs-nixos-unstable.legacyPackages."x86_64-linux") tailscale;
inputs.nixpkgs-nixos-unstable.legacyPackages."x86_64-linux".tailscale;
in { in {
systemd.services.tailscale-autoconnect = { systemd.services.tailscale-autoconnect = {
description = "Automatic connection to Tailscale"; description = "Automatic connection to Tailscale";

View file

@ -1,7 +1,6 @@
{ config, pkgs, inputs, lib, ... }: { config, pkgs, inputs, lib, ... }:
let let
tailscale = inherit (inputs.nixpkgs-nixos-unstable.legacyPackages."x86_64-linux") tailscale;
inputs.nixpkgs-nixos-unstable.legacyPackages."x86_64-linux".tailscale;
in { in {
systemd.services.tailscale-autoconnect = { systemd.services.tailscale-autoconnect = {
description = "Automatic connection to Tailscale"; description = "Automatic connection to Tailscale";

View file

@ -1,7 +1,6 @@
{ config, pkgs, inputs, lib, ... }: { config, pkgs, inputs, lib, ... }:
let let
tailscale = inherit (inputs.nixpkgs-nixos-unstable.legacyPackages."x86_64-linux") tailscale;
inputs.nixpkgs-nixos-unstable.legacyPackages."x86_64-linux".tailscale;
in { in {
systemd.services.tailscale-autoconnect = { systemd.services.tailscale-autoconnect = {
description = "Automatic connection to Tailscale"; description = "Automatic connection to Tailscale";

View file

@ -1,7 +1,6 @@
{ config, pkgs, inputs, lib, ... }: { config, pkgs, inputs, lib, ... }:
let let
tailscale = inherit (inputs.nixpkgs-nixos-unstable.legacyPackages."x86_64-linux") tailscale;
inputs.nixpkgs-nixos-unstable.legacyPackages."x86_64-linux".tailscale;
in { in {
systemd.services.tailscale-autoconnect = { systemd.services.tailscale-autoconnect = {
description = "Automatic connection to Tailscale"; description = "Automatic connection to Tailscale";

View file

@ -96,7 +96,7 @@
}; };
powerManagement = { powerManagement = {
enable = (lib.mkForce true); enable = lib.mkForce true;
resumeCommands = '' resumeCommands = ''
${pkgs.autorandr}/bin/autorandr -c ${pkgs.autorandr}/bin/autorandr -c
''; '';

View file

@ -1,7 +1,7 @@
{ config, pkgs, inputs, ... }: { config, pkgs, inputs, ... }:
let unstable = inputs.nixpkgs-nixos-unstable.legacyPackages.${pkgs.system}; let unstable = inputs.nixpkgs-nixos-unstable.legacyPackages.${pkgs.system};
in { in {
home-manager.users.cyryl = { ... }: { home-manager.users.cyryl = {
accounts.email.accounts.cyplo = { accounts.email.accounts.cyplo = {
primary = true; primary = true;
address = "cyplo@cyplo.dev"; address = "cyplo@cyplo.dev";

View file

@ -1,7 +1,7 @@
{ pkgs }: { pkgs }:
let let
myEmacs = pkgs.emacs-nox; myEmacs = pkgs.emacs-nox;
emacsWithPackages = (pkgs.emacsPackagesGen myEmacs).emacsWithPackages; inherit ((pkgs.emacsPackagesGen myEmacs)) emacsWithPackages;
in emacsWithPackages (epkgs: in emacsWithPackages (epkgs:
(with epkgs.melpaStablePackages; [ magit solarized-theme evil ]) (with epkgs.melpaStablePackages; [ magit solarized-theme evil ])
++ (with epkgs.melpaPackages; [ xterm-color nix-mode ]) ++ (with epkgs.melpaPackages; [ xterm-color nix-mode ])

View file

@ -24,7 +24,7 @@
''; '';
programs.emacs = { programs.emacs = {
enable = true; enable = true;
package = (import ./emacs.nix { inherit pkgs; }); package = import ./emacs.nix { inherit pkgs; };
}; };
} }

View file

@ -12,7 +12,7 @@ in {
nixpkgs.config = { nixpkgs.config = {
allowUnfree = true; allowUnfree = true;
packageOverrides = pkgs: { packageOverrides = pkgs: {
unstable = import unstableTarball { config = config.nixpkgs.config; }; unstable = import unstableTarball { inherit (config.nixpkgs) config; };
}; };
}; };

View file

@ -1,6 +1,6 @@
{ config, pkgs, ... }: { { config, pkgs, ... }: {
services.autorandr.enable = true; services.autorandr.enable = true;
home-manager.users.cyryl = { ... }: { home-manager.users.cyryl = _: {
programs.autorandr = { programs.autorandr = {
enable = true; enable = true;
hooks.postswitch = { hooks.postswitch = {

View file

@ -1,7 +1,6 @@
{ config, pkgs, inputs, ... }: { config, pkgs, inputs, ... }:
let let
tailscale = inherit (inputs.nixpkgs-nixos-unstable.legacyPackages."x86_64-linux") tailscale;
inputs.nixpkgs-nixos-unstable.legacyPackages."x86_64-linux".tailscale;
in { in {
environment.systemPackages = [ tailscale ]; environment.systemPackages = [ tailscale ];

View file

@ -1,13 +1,14 @@
let nixpkgs = import <nixpkgs> { }; (import
in with nixpkgs; (
stdenv.mkDerivation { let
name = "legacy_shell"; lock = builtins.fromJSON (builtins.readFile ./flake.lock);
buildInputs = [ in
(pkgs.writeShellScriptBin "nix-experimental" '' fetchTarball {
exec ${pkgs.nixUnstable}/bin/nix --experimental-features "nix-command flakes" "$@" url = "https://github.com/edolstra/flake-compat/archive/${lock.nodes.flake-compat.locked.rev}.tar.gz";
'') sha256 = lock.nodes.flake-compat.locked.narHash;
cacert
git
];
shellHook = "";
} }
)
{
src = ./.;
}).shellNix