Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(deps): routine update #133

Merged
merged 8 commits into from
May 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 4 additions & 29 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,33 +6,16 @@ on:
branches: [main]
jobs:
flake:
runs-on: ubuntu-latest
strategy:
matrix:
runners: [ubuntu-latest, macos-latest, macos-13]
runs-on: ${{ matrix.runners }}
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v26
- uses: DeterminateSystems/magic-nix-cache-action@v4
- name: Check flake
run: nix flake check
format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v26
- uses: DeterminateSystems/magic-nix-cache-action@v4
- name: Check format
run: |
nix fmt
git diff --exit-code
home-manager:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v26
- uses: DeterminateSystems/magic-nix-cache-action@v4
- name: Build Home Manager configuration
run: |
nix-env -q # TODO: Remove. https://github.com/nix-community/home-manager/pull/3872
nix run '.#home' -- build --flake '.#ci' --print-build-logs
nixos:
runs-on: ubuntu-latest
steps:
Expand All @@ -41,11 +24,3 @@ jobs:
- uses: DeterminateSystems/magic-nix-cache-action@v4
- name: Build NixOS configuration
run: nix run '.#os' -- build -L --flake '.#ci' --print-build-logs
nix-darwin-amd64:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v26
- uses: DeterminateSystems/magic-nix-cache-action@v4
- name: Build nix-darwin configuration
run: nix run '.#os' -- build -L --flake '.#ci-amd64' --print-build-logs
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,8 @@ into the remaining branches. Make sure you never go the other way and merge
non-`main` branches into `main` or you'll end up with non-common
platform-specific stuff in `main`.

<!-- prettier-ignore-start -->
[build-badge]: https://github.com/midchildan/dotfiles/actions/workflows/build.yaml/badge.svg
[build-url]: https://github.com/midchildan/dotfiles/actions/workflows/build.yaml
[nix-shell]: https://nixos.wiki/wiki/Development_environment_with_nix-shell
<!-- prettier-ignore-end -->
1 change: 1 addition & 0 deletions ansible/nix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
url: https://install.determinate.systems/nix
return_content: true
creates: /nix
# prettier-ignore
environment: &env >-
{%- if proxy_env.http_proxy or proxy_env.https_proxy -%}
{%- set extra_env =
Expand Down
19 changes: 9 additions & 10 deletions ansible/vars.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,15 @@ proxy_env: &proxy_env
http_proxy: &http_proxy
https_proxy: &https_proxy
ftp_proxy: &ftp_proxy
no_proxy: &no_proxy
"localhost,\
127.0.0.1,\
127.0.0.0/8,\
10.0.0.0/8,\
172.16.0.0/12,\
192.168.0.0/16,\
.local,\
.home.arpa,\
.test"
no_proxy: &no_proxy "localhost,\
127.0.0.1,\
127.0.0.0/8,\
10.0.0.0/8,\
172.16.0.0/12,\
192.168.0.0/16,\
.local,\
.home.arpa,\
.test"
HTTP_PROXY: *http_proxy
HTTPS_PROXY: *https_proxy
FTP_PROXY: *ftp_proxy
Expand Down
2 changes: 1 addition & 1 deletion files/.local/opt/tldr
Submodule tldr updated 751 files
11 changes: 8 additions & 3 deletions files/.vim/indent/nix.vim
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
if executable('nixpkgs-fmt')
setlocal formatprg=nixpkgs-fmt
elseif executable('nixfmt')
" Standard Nix formatting rules are defined in
" https://github.com/NixOS/rfcs/blob/master/rfcs/0166-nix-formatting.md

setlocal colorcolumn=101

if executable('nixfmt')
setlocal formatprg=nixfmt
elseif executable('nixpkgs-fmt')
setlocal formatprg=nixpkgs-fmt
endif
53 changes: 37 additions & 16 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 6 additions & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,18 @@
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
treefmt-nix = {
url = "github:numtide/treefmt-nix";
inputs.nixpkgs.follows = "nixpkgs";
};
flake-compat = {
url = "github:edolstra/flake-compat";
flake = false;
};
};

outputs = { flake-parts, ... }@inputs:
outputs =
{ flake-parts, ... }@inputs:
flake-parts.lib.mkFlake { inherit inputs; } {
imports = [ ./nix ];
systems = [
Expand Down
21 changes: 11 additions & 10 deletions nix/apps/ansible.nix
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
{ lib
, python3
, writers
{
lib,
python3,
writers,
}:

let
python = python3.withPackages (ps: with ps; [
ansible-core
jmespath
]);
python = python3.withPackages (
ps: with ps; [
ansible-core
jmespath
]
);

binPath = lib.makeBinPath [
python
];
binPath = lib.makeBinPath [ python ];
in
writers.writeBash "ansible.sh" ''
set -euo pipefail
Expand Down
41 changes: 26 additions & 15 deletions nix/apps/default.nix
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
{ flake-parts-lib, lib, config, ... }:
{
flake-parts-lib,
lib,
config,
...
}:

let
inherit (flake-parts-lib) importApply;
nixAttrName = config.dotfiles.nix.package;

flakeModules.updater = {
imports = [
(importApply ./flake-module.nix { inherit config; })
];
imports = [ (importApply ./flake-module.nix { inherit config; }) ];
};
in
{
Expand All @@ -17,16 +20,24 @@ in
inherit flakeModules;
};

perSystem = { pkgs, inputs', self', ... }: {
apps = {
home.program = "${inputs'.home.packages.default}/bin/home-manager";
ansible.program = "${pkgs.callPackage ./ansible.nix { }}";

} // lib.optionalAttrs pkgs.stdenv.isLinux {
os.program = "${self'.packages.nixos-rebuild}/bin/nixos-rebuild";

} // lib.optionalAttrs pkgs.stdenv.isDarwin {
os.program = "${inputs'.darwin.packages.default}/bin/darwin-rebuild";
perSystem =
{
pkgs,
inputs',
self',
...
}:
{
apps =
{
home.program = "${inputs'.home.packages.default}/bin/home-manager";
ansible.program = "${pkgs.callPackage ./ansible.nix { }}";
}
// lib.optionalAttrs pkgs.stdenv.isLinux {
os.program = "${self'.packages.nixos-rebuild}/bin/nixos-rebuild";
}
// lib.optionalAttrs pkgs.stdenv.isDarwin {
os.program = "${inputs'.darwin.packages.default}/bin/darwin-rebuild";
};
};
};
}
14 changes: 8 additions & 6 deletions nix/apps/flake-module.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@ let
nixAttrName = config.dotfiles.nix.package;
in
{
perSystem = { pkgs, self', ... }: {
apps.update.program = "${pkgs.callPackage ./update.nix {
inherit (self') packages;
nix = pkgs.nixVersions.${nixAttrName};
}}";
};
perSystem =
{ pkgs, self', ... }:
{
apps.update.program = "${pkgs.callPackage ./update.nix {
inherit (self') packages;
nix = pkgs.nixVersions.${nixAttrName};
}}";
};
}
Loading